in reply to Removing Poly-ATCG from and Array of Strings

I believe you could easily use grep in your subroutine, as in:

sub remove_poly { my ($array,$lim) = @_; my $len = length $array->[0]; my @sel_array = grep { my $a_count = $_ =~ tr/A//; my $t_count = $_ =~ tr/T//; my $c_count = $_ =~ tr/C//; my $g_count = $_ =~ tr/G//; my $a_portion = $a_count/$len; my $t_portion = $t_count/$len; my $c_portion = $c_count/$len; my $g_portion = $g_count/$len; $_ if ( $a_portion < $lim && $t_portion < $lim && $c_portion < +$lim && $g_portion < $lim ) } @$array; return @sel_array; }

The initial array being big, you could also return a reference to the resulting set, instead of the whole array.