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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| use strict;
use warnings;
use PDF::API2;
use CAM::PDF;
use PDF::Burst ':all';
my $chemin_Scans_recus='./Scans_recus/';
opendir PAI, $chemin_Scans_recus or die "Impossible d'ouvrir le répertoire Scans_recus";
my @Scans_recus = grep { !/^\.\.?$/ } readdir (PAI);
my $flag = 0;
my ($pdf_1, $pdf_2);
my $date_1;
my $date_2;
my $abs_pdf_paire;
my @NF_paire;
my $abs_pdf_impaire;
my @NF_impaire;
foreach my $pdf(@Scans_recus) {
if ($flag == 0) {
my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $block) = stat $pdf;
$date_1 = $mtime;
$pdf_1 = $pdf;
}
if ($flag == 1) {
my ($dev2, $ino2, $mode2, $nlink2, $uid2, $gid2, $rdev2, $size2, $atime2, $mtime2, $ctime2, $blksize2, $block2) = stat $pdf;
$date_2 = $mtime2;
$pdf_2 = $pdf;
}
$pdf='';
$flag++ ;
}
print $pdf_1." : ".$date_1."\n";
print $pdf_2." : ".$date_2."\n";
if ($date_1 > $date_2) {
$abs_pdf_paire = $pdf_2;
@NF_paire = pdf_burst($abs_pdf_paire, 'paire' );
$abs_pdf_impaire = $pdf_1;
@NF_impaire = pdf_burst($abs_pdf_impaire, 'impaire' );
}
else {
$abs_pdf_paire = $pdf_1;
@NF_paire = pdf_burst($abs_pdf_paire, 'paire' );
$abs_pdf_impaire = $pdf_2;
@NF_impaire = pdf_burst($abs_pdf_impaire, 'impaire' );
} |
Partager