The caller() function will do the trick:
gosub(); sub gosub { print "my name is " . get_name(); print "\nI can get it here to, my name " . (caller(0))[3]; } sub get_name { (caller(1))[3]; }
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: How can a subroutine get its name?
by tachyon
in thread How can a subroutine get its name?
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |