On May 17, Peter Cornelius said:
>$returnCode eq "o.k." ? $subject .= " -OK-" : $subject .= " -FAILED-";
You're being bitten by precedence. ?: is stronger than .=, so your code
is like:
($foo == 1 ? $bar .= "this" : $bar) .= "that";
Which means that if $foo is 1, $bar gets "thisthat" tacked onto the end,
if $foo is not 1, $bar gets "that" tacked onto the end.
You can fix this in many ways:
$ret eq 'o.k.' ? ($subject .= " -OK- ") : ($subject .= " -FAILED- ");
$subject .= ($ret eq 'o.k.' ? " -OK- " : " -FAILED- ");
$subject .= (" -FAILED- ", " -OK- ")[$ret eq 'o.k.'];
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter. Brother #734
*** I need a publisher for my book "Learning Perl Regular Expressions" ***