Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
go ahead... be a heretic
 
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 musing on the Monastery: (6)
As of 2014-04-20 07:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls