Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 musing on the Monastery: (14)
As of 2015-07-01 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (15 votes), past polls