<div class="gmail_quote">On Thu, Apr 9, 2009 at 10:19 PM, Tye McQueen <span dir="ltr">&lt;<a href="mailto:tyemq@cpan.org">tyemq@cpan.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="gmail_quote"><div class="im">On Thu, Apr 9, 2009 at 8:52 PM,  <span dir="ltr">&lt;<a href="mailto:seasprocket@gmail.com" target="_blank">seasprocket@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


map evaluates BLOCK in LIST context</blockquote><div> </div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">But that&#39;s ugly -- is there a cleaner way to avoid this problem?<font color="#888888"><br>



</font></blockquote></div><br>
... map { scalar( ... ) } ...</blockquote><div><br>Okay, duh ... thanks for pointing that out.<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<br><br>There are also lots of other ways to get scalar context.  Speaking of bugs, I consider the fact that the following doesn&#39;t fix the problem (at least not in all versions of Perl) to be a Perl bug :)<br>
<br>... map { ( ... )[0] } ...</blockquote><div><br>I was wondering myself why assignment to something like @arr[0] invokes list context. Just a convention, or perhaps some deeper reason? Maybe it is to avoid ambiguities such as @arr[$x..$y] ?<br>

 </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><font color="#888888"><br>Tye<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>==========================<br>2People citizen&#39;s network for climate action: <a href="http://www.2people.org">http://www.2people.org</a><br><br>Greater Seattle Climate Dialogues: <a href="http://www.climatedialogues.org">http://www.climatedialogues.org</a><br>

The Great Warming coalition<br>==========================<br>