in reply to Re: defined() might be a good idea
in thread Check on if statement
Would be better (Lazier) writtenif ( defined($foo) and $foo eq '?' ) { print "\$foo OK!\n"; }
in my opinion anyway...print "\$foo OK!\n" if $foo and $foo eq '?';
Note that since $foo must be a '?', then it cant be _any_ false value, defined being only one of three. Thus you can dispose of the defined test and replace it with simple true or false.
Yves / DeMerphq
---
Software Engineering is Programming when you can't. -- E. W. Dijkstra (RIP)
|
|---|