in reply to Re^2: Yet more Try::Tiny problelms
in thread Yet more Try::Tiny problelms

It works more sanely in Perl 5.18...

In try block We caught Substitute undefined variable

For Perl 5.10-5.16, the easiest fix is:

catch { our $_; # stop lexical $_ from masking global $_ print "We caught $_\n"; }
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Replies are listed 'Best First'.
Re^4: Yet more Try::Tiny problelms
by dd-b (Pilgrim) on May 19, 2013 at 23:08 UTC
    Or use "for" instead of "given" to kick things off.