Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Calling a sub from a variable ?

by inq123 (Sexton)
on Mar 22, 2005 at 10:26 UTC ( [id://441415]=note: print w/replies, xml ) Need Help??


in reply to Calling a sub from a variable ?

I'm not aware of a significant performance penalty on eval, although of course one'd expect a delay due to compilation. But in your case it's unlikely to be slower than &$function. Additionally it offers stability to your program by catching errors.

Security is a concern for eval, but if you're calling the same code &$function anyway, there's no more security concern in eval than in &$function call. The latter also has to turn off strict (partially), not the best thing to do.

So I suggest to stick to eval since AFAIK it works, it performs, and it handles errors.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-23 21:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found