Hi Fulko,<div><br></div><div>I don't think there is a built in. Closest to it would be List::MoreUtils's "zip()". From the doc ( <a href="http://search.cpan.org/~adamk/List-MoreUtils-0.33/lib/List/MoreUtils.pm">http://search.cpan.org/~adamk/List-MoreUtils-0.33/lib/List/MoreUtils.pm</a> ) :</div>
<div><br></div><div><dt style="margin-top:1em;font-family:arial,sans-serif;background-color:rgb(255,255,255);font-size:medium"><a name="mesh_ARRAY1_ARRAY2_[_ARRAY3_..._]">mesh ARRAY1 ARRAY2 [ ARRAY3 ... ]</a></dt><dd style="font-family:arial,sans-serif;background-color:rgb(255,255,255);font-size:medium">
</dd><dt style="margin-top:1em;font-family:arial,sans-serif;background-color:rgb(255,255,255);font-size:medium"><a name="zip"></a><a name="zip_ARRAY1_ARRAY2_[_ARRAY3_..._]">zip ARRAY1 ARRAY2 [ ARRAY3 ... ]</a></dt><dd style="font-family:arial,sans-serif;background-color:rgb(255,255,255);font-size:medium">
<p>Returns a list consisting of the first elements of each array, then the second, then the third, etc, until all arrays are exhausted.</p><p>Examples:</p><pre class="sh_perl sh_sourceCode" style="background-image:initial;background-color:rgb(238,238,238);border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(136,136,136);border-right-color:rgb(136,136,136);border-bottom-color:rgb(136,136,136);border-left-color:rgb(136,136,136);padding-top:1em;padding-right:1em;padding-bottom:1em;padding-left:1em">
    <span class="sh_variable">@x</span> <span class="sh_symbol">=</span> <span class="sh_keyword">qw</span><span class="sh_string">/a b c d/</span><span class="sh_symbol">;</span>
    <span class="sh_variable">@y</span> <span class="sh_symbol">=</span> <span class="sh_keyword">qw</span><span class="sh_string">/1 2 3 4/</span><span class="sh_symbol">;</span>
    <span class="sh_variable">@z</span> <span class="sh_symbol">=</span> mesh <span class="sh_variable">@x</span><span class="sh_symbol">,</span> <span class="sh_variable">@y</span><span class="sh_symbol">;</span>       <span class="sh_comment"># returns a, 1, b, 2, c, 3, d, 4</span>

    <span class="sh_variable">@a</span> <span class="sh_symbol">=</span> <span class="sh_symbol">(</span><span class="sh_string">'x'</span><span class="sh_symbol">);</span>
    <span class="sh_variable">@b</span> <span class="sh_symbol">=</span> <span class="sh_symbol">(</span><span class="sh_string">'1'</span><span class="sh_symbol">,</span> <span class="sh_string">'2'</span><span class="sh_symbol">);</span>
    <span class="sh_variable">@c</span> <span class="sh_symbol">=</span> <span class="sh_keyword">qw</span><span class="sh_string">/zip zap zot/</span><span class="sh_symbol">;</span>
    <span class="sh_variable">@d</span> <span class="sh_symbol">=</span> mesh <span class="sh_variable">@a</span><span class="sh_symbol">,</span> <span class="sh_variable">@b</span><span class="sh_symbol">,</span> <span class="sh_variable">@c</span><span class="sh_symbol">;</span>   <span class="sh_comment"># x, 1, zip, undef, 2, zap, undef, undef, zot</span></pre>
<p><code>zip</code> is an alias for <code>mesh</code>.</p><p><br></p></dd></div><div><br></div><div><font face="arial, sans-serif" size="3"><br></font><br><div class="gmail_quote">On Wed, Jan 18, 2012 at 1:43 PM, Fulko Hew <span dir="ltr"><<a href="mailto:fulko.hew@gmail.com">fulko.hew@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font face="courier new,monospace">Is there an easy way to merge/interleave two arrays (via a built-in)?<br>I haven't found it.  I.e.</font><font face="courier new,monospace"><br>
<br>[1,4,2,5,3,6] = merge([</font><font face="courier new,monospace">1,2,3], [</font><font face="courier new,monospace">4,5,6]);<br>

<br></font><font face="courier new,monospace">TIA<br><font color="#888888">Fulko<br><br></font></font>
<br>_______________________________________________<br>
toronto-pm mailing list<br>
<a href="mailto:toronto-pm@pm.org">toronto-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/toronto-pm" target="_blank">http://mail.pm.org/mailman/listinfo/toronto-pm</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Emil Janev<br>
</div>