in reply to Shortening "$bar{foo} if exists $bar{foo}"?

You don't need the exists keyword either, the following symetric code should work just fine -

# 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}();