March 2002 | Perl Hardware Store | 29 |
sub foo { ... return undef; # False }
if (@result = foo(...)) { ... }
Oops. undef is not false in a list context!
@result has one element, which is undef
if (@result) { ... } # Yes!
Next | Copyright © 2002 M-J. Dominus |