Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
laziness, impatience, and hubris
 
PerlMonks  

Re: How to protect Redis calls with eval ?

by shmem (Canon)
on Apr 27, 2011 at 15:10 UTC ( #901593=note: print w/ replies, xml ) Need Help??


in reply to How to protect Redis calls with eval ?

That could work. However, if you say

$errorcode = eval {@results = $instance_ref->$command(@_)} ;

you are evaluating @results in scalar context and assigning the result of that evaluation to $errorcode - which is not what your want. Just say e.g.

@results = eval { $instance_ref->$command(@_)} ;

and check $@ for errors, which gets set if your eval'ed code dies.


Comment on Re: How to protect Redis calls with eval ?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2014-04-17 02:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (437 votes), past polls