Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Ternary operators: a hinderance, not a help

by GrandFather (Saint)
on Aug 09, 2005 at 22:06 UTC ( [id://482447]=note: print w/replies, xml ) Need Help??


in reply to Ternary operators: a hinderance, not a help

It is interesting to note that the trinary operator can go on the LHS of an assignment:

use warnings; use strict; my $var1 = ""; my $var0 = ""; 1 ? $var1 : $var0 = "Hello "; 0 ? $var1 : $var0 = "World\n"; print $var1.$var0;

Perl is Huffman encoded by design.

Replies are listed 'Best First'.
Re^2: Ternary operators: a hinderance, not a help
by Joost (Canon) on Aug 09, 2005 at 22:39 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-25 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found