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!
How do i make this last line work?
In reply to Coderef from scalar. by vaevictus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |