Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2015-11-25 14:40 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (678 votes), past polls