in reply to How to get the name of an aliased function

Do any of you know of a way for a function to get at the name it was actually called by in the code as opposed to the name of the original function definition?

Short answer - you can't :-) Coderefs have a pointer back to the glob (if any) that defined them. So only one name.

If it were me, I'd probably use closures... something like:

sub make_sub { my $name = shift; return sub { print "My name is $name\n" }; }; *sub1 = make_sub( 'sub1' ); *sub2 = make_sub( 'sub2' ); *sub3 = make_sub( 'sub3' );