<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
David Fetter wrote:<br>
<blockquote type="cite" cite="mid20050301232819.GB24018@fetter.org">
  <pre wrap="">On Tue, Mar 01, 2005 at 12:42:40PM -0800, Kester Allen wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">I like the module solution:

use List::Util qw/sum/
@numbers = qw/3 9 12 1 2/;
$tot = sum ( @numbers );
print $tot;
    </pre>
  </blockquote>
  <pre wrap=""><!---->
That's neat, and easy to read, besides :)

Cheers,
D
  </pre>
</blockquote>
<br>
Agreed!&nbsp; It seems that the two best solutions (as I would call them)
bubbled up to the top immediately.&nbsp; I liked one because it was
built-in, and the other because the language was more set-oriented.<br>
<br>
It got me thinking about the following excerpt from the List::Util man
page, and how the comment "nice to have in the perl core, but..." isn't
really a big problem with Perl (because it's so easily extensible,
unlike the proprietary languages I work with).<br>
<br>
<code>"List::Util</code> contains a selection of subroutines that
people have
expressed would be nice to have in the perl core, but the usage would
not really be high enough to warrant the use of a keyword, and the size
so small such that being individual extensions would be wasteful."<br>
<br>
Under the following listing<br>
<br>
<a class="moz-txt-link-freetext" href="http://cpan.uwinnipeg.ca/htdocs/Scalar-List-Utils/List/Util.html#suggested_additions">http://cpan.uwinnipeg.ca/htdocs/Scalar-List-Utils/List/Util.html#suggested_additions</a><br>
<br>
it took me a while to understand the precedence of the "for" and
"&amp;&amp;", as well as to remember that "foreach" is just a synonym
for "for".<br>
<pre class="moz-signature" cols="72">-- 
Mark Bole
<a class="moz-txt-link-freetext" href="http://www.bincomputing.com">http://www.bincomputing.com</a>
925-287-0366

</pre>
</body>
</html>