Thanks (and you are correct about the misspelling) -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ephraim Dan Sent: Wednesday, June 20, 2007 8:11 PM To: Perl in Israel Subject: Re: [Israel.pm] why did it happen
Operator precedence. ?: comes before =, so it's equivalent to: my $a= ( (27>20)?$a="big":$a) ="small"; so "small" wins thanks for the fun quiz. Oh, and I think you mean "colleague" -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Yossi Itzkovich Sent: Wednesday, June 20, 2007 20:03 To: Perl in Israel Subject: [Israel.pm] why did it happen Hi, A college here wanted to write this code: my $a=(27>20)?"big":"small"; And instead wrote: my $a= (27>20)?$a="big":$a="small"); Surprisingly $a was set to "small". Why ? Yossi _______________________________________________ Perl mailing list [email protected] http://perl.org.il/mailman/listinfo/perl _______________________________________________ Perl mailing list [email protected] http://perl.org.il/mailman/listinfo/perl _______________________________________________ Perl mailing list [email protected] http://perl.org.il/mailman/listinfo/perl
