use strict; my $path_publication = "C:\\Mes_Programmes\\scripts"; my $entree = ""; my $contenu = ""; my @fichiers = (); @fichiers = (); opendir REP, $path_publication or die "Cannot read $path_publication"; @fichiers = readdir REP; closedir REP; foreach $entree (@fichiers) { $contenu = ""; if ($entree =~ /diagram[[:alnum:]]+\.htm/) { open IN, '<' . $path_publication . '\\' . $entree or die "Cannot open $entree"; while () { $contenu = $contenu . $_; } if ( $contenu =~ m[.*.*
.*.*

.*

.*
.*.*.*.*]smi ) { print "IT WORKS"; } close IN; } }