From: Yuval Kogman Date: Fri, 5 Feb 2010 07:07:55 +0000 (+0100) Subject: Docuemnt $_ vs. $@ gotcha in catch for exception stack capturing X-Git-Tag: Try-Tiny-0.05~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0a0641f9ccd6eee5315b38d5f4c5b9d652ec6d12;p=p5sagit%2FTry-Tiny.git Docuemnt $_ vs. $@ gotcha in catch for exception stack capturing --- diff --git a/lib/Try/Tiny.pm b/lib/Try/Tiny.pm index a220602..e1885d7 100644 --- a/lib/Try/Tiny.pm +++ b/lib/Try/Tiny.pm @@ -236,6 +236,11 @@ Inside the catch block the previous value of C<$@> is still available for use. This value may or may not be meaningful depending on what happened before the C, but it might be a good idea to preserve it in an error stack. +For code that captures C<$@> when throwing new errors (i.e. +L), you'll need to do: + + local $@ = $_; + =item finally (&;$) try { ... }