So that just creates the given arguments as dummy functions in the caller's symbol table. See. caller and Of Symbol Tables and Globs for more info.sub build_functions { my(@funcs, $pkg) = (@_, scalar caller); for my $f (@funcs) { *{"$pkg\::$f"} = sub { print "I am &$f\n" }; } } build_functions qw/ foo bar baz /; foo(), bar(), baz(); __output__ I am &foo I am &bar I am &baz
_________
broquaint
In reply to Re: dynamic symbol Exporter
by broquaint
in thread dynamic symbol Exporter
by bsdz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |