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();