Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Dynamically constructed function calls

by tall_man (Parson)
on Nov 03, 2004 at 23:46 UTC ( #405052=note: print w/ replies, xml ) Need Help??


in reply to Dynamically constructed function calls

An eval would do it, like this:

eval "\$f\-\>prefix_$key\( \$atr\)";


Comment on Re: Dynamically constructed function calls
Download Code
•Re^2: Dynamically constructed function calls
by merlyn (Sage) on Nov 04, 2004 at 13:18 UTC
    No. Do not resort to eval-string if other means are available. You're firing up the compiler (slower than almost any other solution), and exposing yourself to hard to debug and hard to secure practices.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (13)
As of 2014-12-22 16:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (121 votes), past polls