sub demo { print "This is the demo function I will pass\n"; } sub take_subs { foreach (@_) { $_->(); } } take_subs(\&demo, sub {print "Another way!\n"});