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