Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: How to map function name to coderef?

by ikegami (Pope)
on Jan 07, 2012 at 00:39 UTC ( #946690=note: print w/ replies, xml ) Need Help??


in reply to Re^2: How to map function name to coderef?
in thread How to map function name to coderef?

Yes, there are ways of fooling strict. It's simpler and clearer to just turn it off in the code in question.

my $func_name = 'f'; my $cr = do { no strict 'refs'; \&$func_name }; say $cr->();


Comment on Re^3: How to map function name to coderef?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2015-05-24 20:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    In my home, the TV remote control is ...









    Results (476 votes), past polls