Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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


Comment on Re: Looking for discussions of "block after or" syntax error
Select or Download Code
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 perusing the Monastery: (5)
As of 2015-07-05 21:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls