From: Yuval Kogman Date: Tue, 23 Feb 2010 11:06:05 +0000 (+0100) Subject: Document lexical lib/Try/Tiny.pm caveat X-Git-Tag: Try-Tiny-0.05~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cbfb532753aff576eda103454606b45a05180170;p=p5sagit%2FTry-Tiny.git Document lexical lib/Try/Tiny.pm caveat --- diff --git a/lib/Try/Tiny.pm b/lib/Try/Tiny.pm index fcb5b74..9b99f91 100644 --- a/lib/Try/Tiny.pm +++ b/lib/Try/Tiny.pm @@ -447,6 +447,24 @@ C blocks, since it isn't people have grown to rely on it. Therefore in the interests of compatibility, C does not disable C<$SIG{__DIE__}> for the scope of the error throwing code. +=item * + +Lexical C<$_> may override the one set by C. + +For example Perl 5.10's C form uses a lexical C<$_>, creating some +confusing behavior: + + given ($foo) { + when (...) { + try { + ... + } catch { + warn $_; # will print $foo, not the error + warn $_[0]; # instead, get the error like this + } + } + } + =back =head1 SEE ALSO