# define your hash entry $foo{bar} = sub { print "Hello Perl!\n" }; # note the use of && operator, which will short-circuit # if $foo{bar} is undef. $foo{bar} && $foo{bar}();
In reply to Re: Shortening "$bar{foo} if exists $bar{foo}"?
by Roger
in thread Shortening "$bar{foo} if exists $bar{foo}"?
by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |