sub exec_callback { my $f = shift; $f->(); } exec_callback(sub {print "hello\n"});