perlquestion
opaltoot
<p>
Dear Monks</p>
<p>Certain purveyors of half truths have led me to believe that the "? :" syntax and the "if then else" syntax spring from the same goodly source. yet i say one is a calumny of the very perl itself. to wit :-</p>
<p>
<code>my $a = 'a';
my $b = 'b';
1 ? $a = 2 : $b = 'x';
print "a is $a\n";
print "b is $b\n";</code>
</p>
<p>outputs
<code>
a is x
b is b
</code></p>