in reply to Analyse an array and join only some elements of it
my @dna_chunks = ...; sub your_test { my $string = shift; # do your test here, and return 1 if it passes } my @used = grep your_test($_), @dna_chunks; my $long_string = join '', @used; print "Used ", scalar(@used), " chunks, ",@dna_chunks - @used, " disca +red";
See grep for details.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Analyse an array and join only some elements of it
by tobyink (Canon) on Jun 15, 2012 at 13:52 UTC |