Well, lots of ways spring to mind. I prefer to think about such problems in terms of how the caller will have to deal with things. I was going to list several examples but once I hit this one I threw the other ones away:
- tye (but my friends call me "Tye")if( ! check_foo("foo",\$foo) ) ) { warn "No foo present\n"; } else { do_stuff( $foo ); }
In reply to (tye)Re: detecting errors when a sub returns undef
by tye
in thread detecting errors when a sub returns undef
by boo_radley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |