Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2016-02-09 14:01 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (316 votes), past polls