CPAN RT 34182 (Locale::Maketext) - Don't unnecessarily localize $@.
authorTodd Rinaldo <toddr@cpan.org>
Tue, 5 Oct 2010 03:15:59 +0000 (20:15 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 5 Oct 2010 03:15:59 +0000 (20:15 -0700)
commit9961f4dd2912b4ce1be748ce46a7bbd36ac60251
treea7e9e487492f7a40a2f38e74964f2bb13b3d1428
parentafa74577a6e8d7cf96f7c62e4acca52fda973699
CPAN RT 34182 (Locale::Maketext) - Don't unnecessarily localize $@.
Do it in scope only so die messages fall through when desired.

Previously, there was test code to make sure $@ was not modified when
maketext is called, but if the caller wraps maketext in an eval, then
it's going to be modified anyways to '' at the least. If the caller
does not wrap a maketext call in an eval and maketext dies, then hiding
the $@ simply confuses the person debugging as to what went wrong.

We do however backup/restore $@ so that it does not break any code that
looks might use $@ after a successful call to maketext.
    eval {...}
    $lm->maketext($@);
    do_something_else($@);
In the above example, $@ would be the same when passed to do_something_else
dist/Locale-Maketext/ChangeLog
dist/Locale-Maketext/lib/Locale/Maketext.pm
dist/Locale-Maketext/t/30_eval_dollar_at.t [new file with mode: 0644]
dist/Locale-Maketext/t/30_local.t [deleted file]