From: Ricardo Signes Date: Thu, 24 Feb 2011 14:48:30 +0000 (-0500) Subject: caveat about error-silencing X-Git-Tag: Try-Tiny-0.10~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a23583177076f06ceaf21f8a403cb8966aeb3802;p=p5sagit%2FTry-Tiny.git caveat about error-silencing --- diff --git a/lib/Try/Tiny.pm b/lib/Try/Tiny.pm index 5055cc1..795272e 100644 --- a/lib/Try/Tiny.pm +++ b/lib/Try/Tiny.pm @@ -157,6 +157,9 @@ Try::Tiny - minimal try/catch with proper localization of $@ =head1 SYNOPSIS +You can use Try::Tiny's C and C to expect and handle exceptional +conditions, avoiding quirks in Perl and common mistakes: + # handle errors with a catch handler try { die "foo"; @@ -164,6 +167,10 @@ Try::Tiny - minimal try/catch with proper localization of $@ warn "caught error: $_"; # not $@ }; +You can also use it like a stanalone C to catch and ignore any error +conditions. Obviously, this is an extreme measure not to be undertaken +lightly: + # just silence errors try { die "foo";