<?xml version="1.0" encoding="windows-1252"?>
<node id="998051" title="Re^5: hash array" created="2012-10-09 14:25:47" updated="2012-10-09 14:25:47">
<type id="11">
note</type>
<author id="190859">
bart</author>
<data>
<field name="doctext">
[doc://map] is a looping function to apply an expression or a block to every item in a list (each item in turn assigned to $_), and collect/return the list of results. It's like:

&lt;c&gt;
my @results;
foreach(@_) {
    push @results, &amp;$CODE();
}
return @results;
&lt;/c&gt;
where &lt;c&gt;$CODE&lt;/c&gt; is the expression (delimited by a comma) or block (no delimiter) in the first argument.

&lt;p&gt;example:
&lt;c&gt;
@output = map $_*2, 1 .. 10;
&lt;/c&gt;
which is identical in result to
&lt;c&gt;
@output = map { $_*2 } 1 .. 10;
&lt;/c&gt;
and which return the even numbers from 2 to 20; the double of all numbers between 1 and 10.
</field>
<field name="root_node">
997975</field>
<field name="parent_node">
997992</field>
</data>
</node>
