1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| open(FICH, accesfichier) or die "IMPOSSIBLE D'OUVRIR LE FICHIER";
my $ligne;
my $compte_motifs_differents = 0;
my $precedent_motif = "initialisation";
while ($ligne = <FICH>){
if($ligne =~ /(motif1)/){
if($precedent_motif ne $1){
$compte_motifs_differents ++;
$precedent_motif = $1;
}
}
if($ligne =~ /(motif2)/){
if($precedent_motif ne $1){
$compte_motifs_differents ++;
$precedent_motif = $1;
}
}
if($ligne =~ /(motif3)/){
if($precedent_motif ne $1){
$compte_motifs_differents ++;
$precedent_motif = $1;
}
}
}
close(FICH); |
Partager