http://www.perlmonks.org?node_id=1031635


in reply to Looking for discussions of "block after or" syntax error

The keyword you're looking for is do...

open(F, "<$somefile") or do { print "Could not open file\n"; exit 3; };
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Replies are listed 'Best First'.
Re^2: Looking for discussions of "block after or" syntax error
by wsanders (Novice) on May 01, 2013 at 21:14 UTC
    Thanks for all the quick replies... I have never really used "do" in Perl for some reason, so I've forgotten about it!