diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-08-18 17:54:49 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-08-18 17:54:49 -0500 |
commit | 181be92311ff699faa2379050d7713f76983f5ee (patch) | |
tree | 1cca02c0e76731a5ce6b0a258d47c035ed9cde90 /lib | |
parent | b49d8ea28d634ee30d2836bff8e8f226836b43a1 (diff) | |
download | try-181be92311ff699faa2379050d7713f76983f5ee.tar.gz try-181be92311ff699faa2379050d7713f76983f5ee.zip |
docs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Try.pm | 82 |
1 files changed, 82 insertions, 0 deletions
@@ -16,6 +16,46 @@ our @EXPORT = our @EXPORT_OK = ('try'); use Try::Tiny (); +=head1 SYNOPSIS + + try { + die "foo"; + } + catch { + when (/foo/) { + warn "Caught foo"; + } + } + +=head1 DESCRIPTION + +This module implements a try/catch/finally statement. It is based heavily on +(and mostly implemented via) L<Try::Tiny>. The differences are: + +=over 4 + +=item * + +It is a statement. C<< my $foo = try { ... } >> doesn't work anymore, but in +return, you don't have to remember the trailing semicolon anymore. C<eval> +still works fine if you need an expression (in 5.14+ at least). + +=item * + +The blocks are ordered, and only one catch and finally block are supported. +C<< try { } finally { } catch { } >> and +C<< try { } catch { } finally { } finally { } >> do not work with this module, +mostly because that's just extra complexity for no real purpose. + +=item * + +C<catch> and C<finally> are no longer exported - they are just part of the +syntax of the C<try> statement. This is almost certainly not an issue. + +=back + +=cut + sub try { my ($try, $catch, $finally) = @_; &Try::Tiny::try( @@ -25,4 +65,46 @@ sub try { ); } +=head1 BUGS + +No known bugs. + +Please report any bugs through RT: email +C<bug-try at rt.cpan.org>, or browse to +L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Try>. + +=head1 SEE ALSO + +L<Try::Tiny>, L<TryCatch> + +=head1 SUPPORT + +You can find this documentation for this module with the perldoc command. + + perldoc Try + +You can also look for information at: + +=over 4 + +=item * AnnoCPAN: Annotated CPAN documentation + +L<http://annocpan.org/dist/Try> + +=item * CPAN Ratings + +L<http://cpanratings.perl.org/d/Try> + +=item * RT: CPAN's request tracker + +L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Try> + +=item * Search CPAN + +L<http://search.cpan.org/dist/Try> + +=back + +=cut + 1; |