Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 scrutinizing the Monastery: (9)
As of 2014-12-21 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (109 votes), past polls