One way could be to use closures. Here's an example snippet (untested):
for my $name (qw(sub1 sub2 sub3)) { my $n = $name; # it is important to declare a new scalar for each +subroutine you create *{$name} = sub { MainSub("sub1"); }; }
In reply to Re: How to get the name of an aliased function
by ambrus
in thread How to get the name of an aliased function
by DrWhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |