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~
In reply to Re: printing options with elsif statement
by dash2
in thread printing options with elsif statement
by splatohara
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |