Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Rethrowing with die $@ considered harmful

by Ieronim (Friar)
on Jul 18, 2006 at 07:48 UTC ( #561949=note: print w/replies, xml ) Need Help??


in reply to Re: Rethrowing with die $@ considered harmful (local $_ buggy)
in thread Rethrowing with die $@ considered harmful

In my own code i always local'ize $_ using for, as recommended in Camel III:

Solution 2

sub dequote { my $string = @_ ? $_[0] : $_; for ($string) { s/^"//; s/"$//; s/\\(.)/$1/g; return $_; } }
It's IMO even more readable than the local $_ variant, and passes all your tests.

     s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2019-11-13 19:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (74 votes). Check out past polls.

    Notices?