Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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 studying the Monastery: (3)
As of 2015-10-04 03:18 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (98 votes), past polls