use File::Basename;
use File::Copy;
use MIME::Lite;
use Cwd;
use POSIX 'strftime';
use strict;
use warnings;
my $DirLogMDP = "C:/logs" ;
my $FicLog = "toto.log" ;
my $Ligne1Export="export=";
my $Ligne2Export="jour=";
my $Ligne;
my $anomalies1="";
my $anomalies2="";
open (FIC, "<${DirLogMDP}/${FicLog}") || die "Ouverture impossible du fichier ${FicLog} : $!";
while ($Ligne = <FIC> )
{
if (grep { $Ligne =~ m/$_/g } $Ligne1Export || grep { $Ligne =~ m/$_/g } $Ligne2Export)
{
my ($envoi1, $anomalies1) = $Ligne =~ /(\d+).+(\d+)/;
my ($envoi2, $anomalies2) = $Ligne =~ /(\d+).+(\d+)/;
print "$Ligne\n";
print "$anomalies1\n";
print "$Ligne\n";
print "$anomalies2\n";
}
}
close (FIC);
Partager