<?xml version="1.0" encoding="windows-1252"?>
<node id="991187" title="Re: filtering an array" created="2012-09-01 15:41:47" updated="2012-09-01 15:41:47">
<type id="11">
note</type>
<author id="989386">
philiprbrenan</author>
<data>
<field name="doctext">
&lt;code&gt;
use feature ":5.14";
use warnings FATAL =&gt; qw(all);
use strict;
use Data::Dump qw(dump pp);

my @positions;
for(split /\n/, &lt;&lt;'END') 
1 ACAC
2 AGAC
3 AGTC
4 ACCA
END
 {push @positions, [split/ /] unless /[GT]/;
 }

say "With bases: ", dump(@positions);

$_ = $_-&gt;[0] for @positions;
say "Without bases: ", dump(@positions);

&lt;/code&gt;
&lt;p&gt;Produces&lt;/p&gt;
&lt;code&gt;
With bases: ([1, "ACAC"], [4, "ACAC"])
Without bases: (1, 4)
&lt;/code&gt;</field>
<field name="root_node">
991184</field>
<field name="parent_node">
991184</field>
</data>
</node>
