<?xml version="1.0" encoding="windows-1252"?>
<node id="140343" title="(ar0n) Re (3): Storing Info" created="2002-01-21 06:58:36" updated="2005-07-27 19:21:58">
<type id="11">
note</type>
<author id="8948">
ar0n</author>
<data>
<field name="doctext">
&lt;blockquote&gt;
  &lt;i&gt;
    He posted code that works,
  &lt;/i&gt;
&lt;/blockquote&gt;
&lt;p&gt;
  Err, actually, he didn't. See [dvergin]'s post.
&lt;/p&gt;
&lt;blockquote&gt;
  &lt;i&gt;
    I don't see what's so bad about teaching him to do it
    better (as opposed to at all). map and grep aren't
    immediately intuitive unless you are already seeped in
    lisp.
  &lt;/i&gt;
&lt;/blockquote&gt;
&lt;p&gt;
  That's why I told him to take a look at [map] and [grep]
  (implying, "Read the documentation"). I am not 'seeped in 
  Lisp'. In fact, I have just started learning some Common 
  Lisp, yet I've been using [map] and [grep] in Perl for 
  quite some time now. I assume he's intelligent enough to 
  understand the definition of [grep]:
  &lt;pre&gt;
    grep - locate elements in a list test true against a given criterion
  &lt;/pre&gt;
  And, using that definition, construct something like 
  &lt;code&gt;
    my @matches = grep { ... } keys %friends
  &lt;/code&gt;
  as he is apparently already able to retrieve hash keys.
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
  &lt;i&gt;
    Why not just tell him to put the conditional into a grep statement and it will spit out the right hashes?
  &lt;/i&gt;
&lt;/blockquote&gt;
&lt;p&gt;
  Because he can deduce that from reading the documentation on [grep]. One of Perl's great resources is its extensive documentation. Learning to read the documentation is a good thing, in my opinion.
&lt;/p&gt;
&lt;blockquote&gt;
  &lt;i&gt;
    As an added bonus, less people will think that you are a grumpy loser.
  &lt;/i&gt;
&lt;/blockquote&gt;
&lt;p&gt;
  So I'm a grumpy loser now?
&lt;/p&gt;
&lt;p&gt;
  &lt;small&gt;&amp;#91; &lt;a href="/index.pl?node=ar0n&amp;lastnode_id=1072"&gt;ar0n&lt;/a&gt; -- want job (boston) &amp;#93;&lt;/small&gt;
&lt;/p&gt;</field>
<field name="root_node">
140317</field>
<field name="parent_node">
140337</field>
</data>
</node>
