Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Calling a sub from a variable ?

by inq123 (Sexton)
on Mar 22, 2005 at 10:26 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (1)
As of 2023-09-28 21:07 GMT
Find Nodes?
    Voting Booth?

    No recent polls found