See the perlsub and perlref manpages for more details.sub take_subs { $_->() for @_; } sub foo { print "in foo()\n" } sub bar { print "in bar()\n" } take_subs(\&foo, \&bar); # ^^ ^^ __output__ in foo() in bar()
_________
broquaint
In reply to Re: subs as args
by broquaint
in thread subs as args
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |