Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old October 12th, 2000, 11:22 AM
Tigger Tigger is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 0 Tigger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
im having some problems with a block of code and could do with some help. i am doing a simple nested if statment following the lines of:

if($Temp->[$Number][2]>=@Place[2]){
do stuff
}

however i need to have another method of entering the "do stuff" section. the elseif command would work but as it's a nested if statement it would be very untidy. I was thinking of using the or logical operator but cannot get it to work. Can anyone tell me what im doing wrong or if what i am trying to do cannot be done at all?

the way im currently using the or operator is:

if($Temp->[$Number][2]>=@Place[2]| |@Place[2]==10){
do stuff
}

on another issue.. is their another way of achieveing the same result as the if statement shown above but more compact?

thanks in advance

Reply With Quote
  #2  
Old October 17th, 2000, 04:19 AM
r-c r-c is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: Auckland, New Zealand
Posts: 9 r-c User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to r-c
I think it should work if you use "| |" (no space between them) or you could use "or".

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Perl if statements combined with logical operators.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway