in reply to [untitled node, ID 193989]
It can get its name by using one of the forms of caller(). Try this:
foo(); sub foo { my @callinfo = caller(0); print "i am $callinfo[3]\n"; } [download]