Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Surprised by Perl parse of ternary operator

by moritz (Cardinal)
on Dec 16, 2011 at 12:50 UTC ( #943937=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $x = $condition ? $a : $b;
    
  2. or download this
    (my $x = $condition) ? $a : $b
    
  3. or download this
    # program (note that Perl 6 uses ??!! instead of ?:)
    1 ?? $_ = 3 !! $_ = 5
    
    # output from the Perl 6 standard grammar:
    Precedence of = is too loose to use between ?? and !!; please use pare
    +ns around inner expression at ...
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://943937]
help
Chatterbox?
[Discipulus]: shmem the first time I was in germany I was so smart to learn by heart the address of the hostel: Einbahnstraße..
[Discipulus]: james28909 you are welcome
james28909 doesnt drink much alcohol
james28909 does enjoy blazing up though
james28909 also walks around hunting for his cell phone while using its flashlight function

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2018-05-20 16:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?