sub s1 { my $sub=shift; # get it! # you may want to add checks => perldoc -f ref. print "s1"; $sub->(); # execute it! }