Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Looking for discussions of "block after or" syntax error

by tobyink (Abbot)
on May 01, 2013 at 19:34 UTC ( #1031635=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031635]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2016-09-27 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (502 votes). Check out past polls.