Hi,
Can someone explain why I am not getting the expected result from my shorthand (if,then,else).
I have
I expected the same result if i used
Only it doesn't matter whether the conditon evaluates to true or false, both get concatenated to the $body string?
Why is this happening?
Cheers,
1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Google Rank Extractor -> Perl beta with FusionCharts
Can someone explain why I am not getting the expected result from my shorthand (if,then,else).
I have
Code:
if($rs[0]{'Dear'} ne ""){$body .= $rs[0]{'Dear'};
else{$body .= $rs[0]{'FirstName'};}
I expected the same result if i used
Code:
($rs[0]{'Dear'} ne "") ? $body .= $rs[0]{'Dear'} : $body .= $rs[0]{'FirstName'};
Why is this happening?
Cheers,
1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Google Rank Extractor -> Perl beta with FusionCharts