in reply to look for substrings and getting their location
$seq ~~ m:overlap/ GUAUG /; say "Found ", +@$0, " at:"; say "\t", $_.pos for @$0;
So in Perl 5.8 and above you could write:
use Perl6::Rules; use Perl6::Say; $seq =~ m:overlap/ GUAUG /; say "Found ", scalar(@$0), " at:"; say "\t", $_->pos for @$0;
And, as the modifier suggests, it correctly handles overlaps in the data.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: In Perl 6 that's just...
by Juerd (Abbot) on May 10, 2004 at 20:38 UTC | |
by TheDamian (Vicar) on May 10, 2004 at 20:59 UTC |