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