$ perl -Mstrict -E '{ my %foo = (test => 1); my $sub = \&test; $sub->() } sub test { print $foo{test} }' Global symbol "%foo" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors.