From: Yuval Kogman Date: Tue, 20 Oct 2009 21:31:54 +0000 (+0200) Subject: document the @_ gotcha X-Git-Tag: Try-Tiny-0.03~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=318cb1eb7cbaceb01b470f83c816b669885a1ec9;p=p5sagit%2FTry-Tiny.git document the @_ gotcha --- diff --git a/lib/Try/Tiny.pm b/lib/Try/Tiny.pm index 5212a30..7c0256d 100644 --- a/lib/Try/Tiny.pm +++ b/lib/Try/Tiny.pm @@ -291,6 +291,27 @@ concisely match errors: =item * +C<@_> is not available, you need to name your args: + + sub foo { + my ( $self, @args ) = @_; + try { $self->bar(@args) } + } + +=item * + +C returns from the C block, not from the parent sub (note that +this is also how C works, but not how L works): + + sub bar { + try { return "foo" }; + return "baz"; + } + + say bar(); # "baz" + +=item * + C introduces another caller stack frame. L is not used. L will report this when using full stack traces. This lack of magic is considered a feature.