in reply to printing options with elsif statement
You're confusing equality (==) with assignment (=) - an easy mistake to make even for experienced programmers.
if ($foo == 3) checks if $foo is equal to 3.
if ($foo = 3) gives $foo a value of 3. This assignment then itself evaluates to 3, which is "true", so the if statement is always true.
dave hj~
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: printing options with elsif statement
by splatohara (Novice) on Feb 18, 2002 at 17:34 UTC | |
by dash2 (Hermit) on Feb 18, 2002 at 18:20 UTC |