<?xml version="1.0" encoding="windows-1252"?>
<node id="296869" title="Re: Re: Think for yourself." created="2003-10-06 01:43:29" updated="2005-06-05 05:17:58">
<type id="11">
note</type>
<author id="145647">
zengargoyle</author>
<data>
<field name="doctext">
&lt;code&gt;
    my @L = map {
        fix($_-&gt;[4]);
        fix($_-&gt;[8]);
        [ @$_[0,2,3,6,4,8] ]
    } grep {
        @$_ == 10 and
        ($_-&gt;[7] eq 'IP') and ($_-&gt;[9] eq 'local')
    } map {
        [ split ]
    } &lt;F&gt;; 
&lt;/code&gt;
&lt;p&gt;i think map in void context is just fine.  if i decided to place my data in a hash for later lookup i just might do so at the end of the first map (instead of returning an array of arrays).  i'm sure i wouldn't try and re-craft the code to use a &lt;tt&gt;for&lt;/tt&gt; just to appease.&lt;/p&gt;
&lt;p&gt;much in the same way i use the 'useless' cat in my shell pipelines.&lt;/p&gt;
&lt;code&gt;
$ cat foo.txt | fgrep blah
&lt;/code&gt;
&lt;p&gt;it's much easier to decide to add more files to the cat (try that with &lt;file ).  or to replace the cat with another command that generates the data.  why on earth would i continuously rewrite my commands when i can up-arrow and add easily to the beginning?&lt;/p&gt;
&lt;code&gt;
$ fgrep blah &lt;foo.txt | consolidate | dump
$ preproc &lt;foo.txt | fgrep blah | consolidate | dump
$ additional &lt;foo.txt | preproc | fgrep blah | consolidate | dump

# vs

$ cat foo.txt | fgrep blah | consolidate | dump
$ cat foo.txt | preproc | fgrep blah | consolidate | dump
$ cat foo.txt bar.txt | additional | preproc | fgrep blah | consolidate | dump
$ real_stream | additional | preproc | fgrep blah | consolidate | dump
&lt;/code&gt;
&lt;p&gt;i'll keep my useless &lt;tt&gt;cat&lt;/tt&gt; and my &lt;tt&gt;map&lt;/tt&gt; in void context thank you much.  they're my artifacts of iterative development.&lt;/p&gt;</field>
<field name="root_node">
296742</field>
<field name="parent_node">
296864</field>
</data>
</node>
