Just another Perl shrine | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
According to the docs (Perlfunc) on return: If no EXPR is given, returns an empty list in list context, the undefined value in scalar context, and (of course) nothing at all in a void context. I think this is mentioned in Perl Best Practices. I don't have a copy handy to verify it. So, the better practice seems to be to replace return undef; with return;. A quick test shows that this works fine for boolean tests as well. We get the best of all worlds.
HTH, Charles In reply to Re^3: getting 2 things done at once with Class::Base (return undef)
by CharlesClarkson
|
|