in reply to Special variable to return current sub name?
Nope but you can still get that info.
#!/usr/bin/perl print "Hello\n"; &ThisSub; exit(0); sub ThisSub { my $sub = (caller(0))[3]; $sub =~ s/.*:://; # remove the package name, comment out of you wan +t it too print "I am now in sub $sub\n"; return 1; # or simply 1; }
|
|---|