my $string = quotemeta shift; die "Not a valid nucleotide sequence" if $string =~ /[^AGTC]/; #### my $string = "TGAT"; my @nts = map { my $tmp = $string; substr $tmp, $_, 1, '.'; $tmp; } (0 .. length ($string) -1); my $groupings = join '|', @nts; my $sample = "TGATTGGAATGTTAGAT"; while ( $sample =~ /($groupings)/go ) { print "Matched $1 ending at position ", pos $sample, "\n"; } #### @_=qw; Just another Perl hacker,; ;$_=q=print "@_"= and eval;