John W. Krahn wrote:
Shawn Corey wrote:
for my $key ( sort keys %{ { STOPWORDS } } ){
 my $value = ${ { STOPWORDS } }{$key};


In both lines you are copying the entire list to an anonymous hash.  If you
want efficient code (and less punctuation) you should just use a hash.

Efficiency. There's that word again. If you truly want efficient code you won't create subroutines that return lists. They would return references to the lists or store them in global arrays.


--

Just my 0.00000002 million dollars worth,
   --- Shawn

* Perl tutorials at http://perlmonks.org/?node=Tutorials

* Always write your code as though you aren't going to see it
* for another 25 years and then one day your boss comes up to you
* and says, "I want these changes and I want them yesterday!"

"Probability is now one. Any problems that are left are your own."
   SS Heart of Gold, _The Hitchhiker's Guide to the Galaxy_


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to