doy/try-tiny — pull request #3 by 2shortplanks (2012-07-25 15:21:31+00:00)
Title: Named try/catch/finally blocks

Hello!

This pull request names the try/catch/finally blocks if Sub::Name is installed.

Consider:

```perl
package Foo;

use Try::Tiny;

sub wibble {
try {
die "Not enough kittens";
} catch {
die "OH NOES!";
}
}

package main;

Foo::wibble()
```

This normally produces:

```
client-169:~ mark$ perl -MCarp::Always foo.pl
OH NOES! at foo.pl line 9.
Foo::__ANON__('Not enough kittens at foo.pl line 7.\x{a}\x{9}Foo::__ANON__() called ...') called at /Users/mark/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/Try/Tiny.pm line 108
Try::Tiny::try('CODE(0x7fdb02802f90)', 'Try::Tiny::Catch=REF(0x7fdb0281a0a0)') called at foo.pl line 11
Foo::wibble() called at foo.pl line 15
```

But with my pull request produces

```
client-169:~ mark$ perl -MCarp::Always foo.pl
OH NOES! at foo.pl line 9.
Foo::catch {...} ('Not enough kittens at foo.pl line 7.\x{a}\x{9}Foo::try {...}() called...') called at /Users/mark/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/Try/Tiny.pm line 108
Try::Tiny::try('CODE(0x7fb0c9802f90)', 'Try::Tiny::Catch=REF(0x7fb0c981a0d0)') called at foo.pl line 11
Foo::wibble() called at foo.pl line 15
```

(I also changed the github page in the docu since it's terribly out of date)