Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Possible precedence issue with control flow operator

by Eily (Monsignor)
on Jan 13, 2020 at 11:23 UTC ( #11111356=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl -MO=Deparse -e "sub test { return int(rand(2)) or print 'Nope' }"
    sub test {
        print 'Nope' unless return int rand 2;
    }
    -e syntax OK
    
  2. or download this
    my $result;
    $result = something() or croak "Something went wrong";
    return $result;
    
  3. or download this
    sub mySub
    {
      ...
      something() or croak "Times are a'croaking";
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2020-09-29 08:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (146 votes). Check out past polls.

    Notices?