Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add warning to POD about try/finally #15

Merged
merged 1 commit into from

2 participants

David D Lowe Jesse Luehrs
David D Lowe

try/finally suppresses errors, which is unexpected behaviour if you come
from another programming language.

David D Lowe Flimm Add warning to POD about try/finally
try/finally suppresses errors, which is unexpected behaviour if you come
from another programming language.
79039ae
Jesse Luehrs doy merged commit ef622e7 into from
Jesse Luehrs
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 7, 2014
  1. David D Lowe

    Add warning to POD about try/finally

    Flimm authored
    try/finally suppresses errors, which is unexpected behaviour if you come
    from another programming language.
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/Try/Tiny.pm
7 lib/Try/Tiny.pm
View
@@ -232,6 +232,13 @@ C<finally> blocks are always executed making them suitable for cleanup code
which cannot be handled using local. You can add as many C<finally> blocks to a
given C<try> block as you like.
+Note that adding a C<finally> block without a preceding C<catch> block
+suppresses any errors. This behaviour is consistent with using a standalone
+C<eval>, but it is not consistent with C<try>/C<finally> patterns found in
+other programming languages, such as Java, Python, Javascript or C#. If you
+learnt the C<try>/C<finally> pattern from one of these languages, watch out for
+this.
+
=head1 EXPORTS
All functions are exported by default using L<Exporter>.
Something went wrong with that request. Please try again.