Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Operator Precedence

by tachyon (Chancellor)
on Jul 22, 2001 at 16:45 UTC ( #98813=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    open FILE, "<$file" || die "Oops $!\n";
    
  2. or download this
    print ("Hello World!\n");
    close (FILE);
    
  3. or download this
    /foo/ ? $a += 1 : $a -= 1;
    # parses as
    ...
    # but
    $a += /foo/ ? 1 : -1;
    # will work as expected.
    
  4. or download this
    $_ = 'foo';
    
    ...
    (/foo/) ? print "Found foo\n" : print "No foo here\n";
    print /foo/   ? "Found foo\n" : "No foo here\n";
    print (/foo/) ? "Found foo\n" : "No foo here\n";
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2021-10-24 16:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (89 votes). Check out past polls.

    Notices?