diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-08-18 18:03:05 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-08-18 18:03:05 -0500 |
commit | 44f60cee044153a2855dd5a92ce624f1747d1e6c (patch) | |
tree | 423d23e8349314e21684ab61122ace97ca7dee57 | |
parent | 845e675a8d6e2c72f57d01636e848724c9412378 (diff) | |
download | try-44f60cee044153a2855dd5a92ce624f1747d1e6c.tar.gz try-44f60cee044153a2855dd5a92ce624f1747d1e6c.zip |
more documentation
-rw-r--r-- | lib/Try.pm | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -56,6 +56,21 @@ syntax of the C<try> statement. This is almost certainly not an issue. =cut +=head1 EXPORTS + +=head2 try + +C<try> takes a block to run, and catch exceptions from. The block can +optionally be followed by C<catch> and another block and C<finally> and another +block. The C<catch> block is run when the C<try> block throws an exception, and +the exception thrown will be in both C<$_> and C<@_>. The C<finally> block will +be run after the C<try> and C<catch> blocks regardless of what happens, even if +the C<catch> block rethrows the exception. The exception thrown will be in +C<@_> but B<not> C<$_> (this may change in the future, since I'm pretty sure +the reasoning for this is no longer useful in 5.14). + +=cut + sub try { my ($try, $catch, $finally) = @_; &Try::Tiny::try( |