summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-08-18 18:03:05 -0500
committerJesse Luehrs <doy@tozt.net>2012-08-18 18:03:05 -0500
commit44f60cee044153a2855dd5a92ce624f1747d1e6c (patch)
tree423d23e8349314e21684ab61122ace97ca7dee57
parent845e675a8d6e2c72f57d01636e848724c9412378 (diff)
downloadtry-44f60cee044153a2855dd5a92ce624f1747d1e6c.tar.gz
try-44f60cee044153a2855dd5a92ce624f1747d1e6c.zip
more documentation
-rw-r--r--lib/Try.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Try.pm b/lib/Try.pm
index bb7d563..c23a82c 100644
--- a/lib/Try.pm
+++ b/lib/Try.pm
@@ -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(