sub test { my $function_ref = shift; # if ( $function_ref == package1::method1 ) # do something # elsif ( $function_ref == package2::method2) # do something ... } test(\&package1::method1); test(\&package2::method2);
In reply to find out method name from the reference by perlfan99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |