in reply to Help with this statement
I believe your problem is the non-transative nature of the perl || and 'or' operators. in this case you are asking if it is equal to 456 or just 453. 453 of course is never 0 and therefore will be true. Hence printing something. to fix this just add.
That should clear things up.if ($value == 456 || $value == 453){ print something; } else { print nothing; }
|
---|
Replies are listed 'Best First'. | |
---|---|
(cLive ;-) Re: Help with this statement
by cLive ;-) (Prior) on Jan 11, 2002 at 23:20 UTC | |
by Parham (Friar) on Jan 12, 2002 at 01:56 UTC | |
Re: Re: Help with this statement
by basicdez (Pilgrim) on Jan 11, 2002 at 20:59 UTC |
In Section
Seekers of Perl Wisdom