sub foo { my $bar = sub { print "In bar\n"; }; $bar->(); };