Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^4: accessing stashes

by ikegami (Pope)
on Mar 01, 2019 at 19:52 UTC ( #1230735=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub get_code_ref_by_fqn {  # Fully qualified name
       my ($fqn) = @_;
    ...
       return undef if ref(\$glob_or_code) ne 'GLOB';
       return *$glob_or_code{CODE};
    }
    
  2. or download this
    sub get_code_ref_by_fqn {  # Fully qualified name
       my ($fqn) = @_;
    ...
       return undef if !defined(&$fqn);
       return \&$fqn;
    }
    
  3. or download this
    use 5.012;
    use warnings;
    ...
    say get_code_ref_by_fqn('Foo::Bar::x') // '[undef]';
    say get_code_ref_by_fqn('Foo::Bar::y') // '[undef]';
    say get_code_ref_by_fqn('Foo::Bar::z') // '[undef]';
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1230735]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2021-04-15 18:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?