If you can't omit keys with undefined values, change your code to:
sub check_foo { if (exists $foo{bar} and $foo{bar}) return $foo{bar}; } else { return undef; } }
In reply to Re: detecting errors when a sub returns undef
by converter
in thread detecting errors when a sub returns undef
by boo_radley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |