<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Courier" size="3" style="font: 12.0px Courier">$ cat j.pl</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Courier" size="3" style="font: 12.0px Courier">my $a = blah();</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Courier" size="3" style="font: 12.0px Courier">print "$a\n";</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Courier" size="3" style="font: 12.0px Courier">sub blah {</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Courier" size="3" style="font: 12.0px Courier"><SPAN class="Apple-converted-space">   </SPAN>return (7,8);</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Courier" size="3" style="font: 12.0px Courier">}</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Courier" size="3" style="font: 12.0px Courier">$ perl j.pl</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Courier" size="3" style="font: 12.0px Courier">8</FONT></P> </BLOCKQUOTE></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Perl knows that blah() is being called in scalar context, so it evaluates (7,8) in scalar context, which is 8, because it's the rightmost value after the comma.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Now, if you'd said</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>my ($a) = blah();</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>then $a will be 7, and 8 gets ignored.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>xoxo,</DIV><DIV>Andy</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>--</DIV><DIV>Andy Lester =&gt; andy@petdance.com =&gt; www.petdance.com =&gt; <A href="AIM:petdance">AIM:petdance</A></DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR></BODY></HTML>