Maybe you could play with AUTOLOAD() instead of aliases and caller. AUTOLOAD is made to do this sort of thing.
use strict; use warnings; sub AUTOLOAD { my $called = ( split /::/, $main::AUTOLOAD )[-1]; my %recognized; @recognized{'this', 'that', 'those'} = (); exists $recognized{$called} or die "I don't know how to $called.\n"; print "I was called as $called\n"; } this(); that(); those(); woops();
Dave
In reply to Re: How to get the name of an aliased function
by davido
in thread How to get the name of an aliased function
by DrWhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |