[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl-Forum] Conditional operator problem



I am having some difficulty using the ?: notation on MacPerl 5.2.0r4.

Option 1 is working, while option 2 always results in 'Ý'. If I remove the
scalar assignment within the ? to print, it works fine. Should I not try to
reassign $reply using ?: notation? 

set $reply :    $reply = $subject =~ /Re:/;
option 1   : if ($reply eq 1) { $reply = '+' } else {$reply = 'Ý'};
option 2   :    ($reply eq 1) ? $reply = '+' : $reply = 'Ý';

I note that the pod says 'The operator may be assigned to if both the 2nd and
3rd arguments are legal lvalues'.

Thanks for any help
rory

--
		  Rory Campbell-Lange   +   The Campbell-Lange Workshop
 			                  London




==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-forum-request@macperl.org