#!/usr/bin/perl -w
# 2003/11/6 - I. Dutour

my $motif = 'AGAA';
my $sequence = 
   'AACAAATTGAAACAATAAACAGAAACAAAAATGGATGCGATCAAGAAAAAGATGC'.
   'AGGCGATGAAAATCGAGAAGGATAACGCTCTCGATCGAGCCGATGCCGCGGAAGA'.
   'AAAAGTACGTCAAATGACGGAAAAGTTGGAACGAATCGAGGAAGAACTACGTGAT'.
   'ACCCAGAAAAAGATGATGCNAACTGAAAATGATTTAGATAAAGCACAGGAAGATT'.
   'TATCTGTTGCAAATACCAACTTGGAAGATAAGGAAAAGAAAGTTCAAGAGGCGGA'.
   'GGCTGAGGTAGCANCCCTGAATCGTCGTATGACACTTCTGGAAGAGGAATTGGAA'.
   'CGAGCTGAGGAACGTTTGAAGATTGCAACGGATAAATTGGAAGAAGCAACACATA'.
   'CAGCTGATGAATCTGAACGTGTTCGCNAGGTTATGGAAA';

my @positions;

foreach $i (0..length $sequence) {
    if ( $motif eq substr( $sequence, $i, length $motif) ) {
	push @positions, $i;
    }
}

print "Les positions trouvees sont : @positions.\n";

