sub foo { print "hello world" }; # more or less equivalent to: BEGIN { *foo = sub { print "hello world" }; }