From: David Lowe Date: Fri, 7 Mar 2014 17:33:54 +0000 (+0000) Subject: Add warning to POD about try/finally X-Git-Tag: Try-Tiny-0.20~2^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=79039ae433128d824ddf3d930909434f9fe645d3;p=p5sagit%2FTry-Tiny.git Add warning to POD about try/finally try/finally suppresses errors, which is unexpected behaviour if you come from another programming language. --- diff --git a/lib/Try/Tiny.pm b/lib/Try/Tiny.pm index 62a8ac0..91307b4 100644 --- a/lib/Try/Tiny.pm +++ b/lib/Try/Tiny.pm @@ -232,6 +232,13 @@ C blocks are always executed making them suitable for cleanup code which cannot be handled using local. You can add as many C blocks to a given C block as you like. +Note that adding a C block without a preceding C block +suppresses any errors. This behaviour is consistent with using a standalone +C, but it is not consistent with C/C patterns found in +other programming languages, such as Java, Python, Javascript or C#. If you +learnt the C/C pattern from one of these languages, watch out for +this. + =head1 EXPORTS All functions are exported by default using L.