my $code='{ print "hello, perlmonks\n"; }'; sub samething { print "hello, perlmonks\n"; } &specialfunction( \&samething ); #normal &specialfunction( { print "hello, perlmonks\n"; } ); #also valid &specialfunction( $code ); #not a coderef!