http://www.perlmonks.org?node_id=561949


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