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

Re: Sub ref from string without eval

by kennethk (Abbot)
on Apr 02, 2012 at 14:51 UTC ( #963028=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $x = 'Foo';
    
    my $sub_ref = do {
        no strict 'refs';
        \&{$x};
    };
    
  2. or download this
    my $x = 'Foo';
    
    my $sub_ref = \&{$x};
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2020-11-25 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?