use warnings; use strict; use B qw(svref_2object); sub foo { print "I really do exist!\n"; } for my $coderef ( \&foo, \&bar ) { unless ( defined &$coderef ) { printf "could not call %s\n", svref_2object( $coderef )->GV->N +AME; } } # A symbol table entry is created for bar print "$::{ 'foo' }\n$::{ 'bar' }\n";
In reply to Re^2: Getting the name of sub from sub reference
by Anonymous Monk
in thread Getting the name of sub from sub reference
by gri6507
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |