And just repeat '*mySub2 = \&mySub' for each sub you need to setup (changing the name of mySub2).sub mySub { print "this sub\n"; } *mySub2 = \&mySub; mySub2();
If you want to learn more about typeglobs, I recomend Advanced perl programming (there are a lot of other goodies in there as well).
In reply to Re: variable sub function?
by c-era
in thread variable sub function?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |