Just write
if (defined(param('foo'))) { print "yes, we have a foo\n"; } else { print "out of luck, pal\n"; }
I also don't understand what you mean that I don't have to compare booleans to true or false.
The question is $thing the same as true? is nearly the same as is $thing true?. When you write if ($thing) { ... } then perl already asks is $thing true? - no need to make it more complicated by explcitly comparing it to true (which doesn't exist in Perl 5 anyway).
In reply to Re^3: scalar values assignment
by moritz
in thread scalar values assignment
by gogoglou
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |