in reply to Re: Name of caller if aliased?
in thread Name of caller if aliased?
Yes I could parse the stash of the calling package and compare the CODE-slots to identify aliases.
But apart from the overhead, the results won't be necessarily unique.
$\="\n"; sub show { print join "\t",(caller(0))[0..3]; }; show(); package Test; *func = \&main::show; *funk = \&main::show; func(); funk();
/usr/bin/perl -w /tmp/tst.pl main /tmp/tst.pl 6 main::show Test /tmp/tst.pl 13 main::show Test /tmp/tst.pl 14 main::show
|
|---|