in reply to perl varible that holds method name

This information can be accessed via caller
sub method1 { my $name = (caller(0))[3]; print("$name\n"); } method1(); # main::method1 *method2 = \&method1; method2(); # main::method1 also

Replies are listed 'Best First'.
Re^2: perl varible that holds method name
by Anonymous Monk on Sep 16, 2009 at 21:42 UTC
    Thanks.