Hi all, I'm trying to write a Perl script that calls another script, that reads an entire directory. I don't get any errors, but i don't get the expected result either. I don't get anything on the screen.
I don't need to output anything on screen. The script I'm calling in the exec()
statement should read each image file into the DIR
directory, and create a file where it stores some data extracted from that image.
The script in the exec()
statement should then loop until all images into the directory are read.
#!/usr/bin/perl -w
use strict;
use warnings;
use diagnostics;
use CGI qw/:standard/;
use CGI::Carp 'fatalsToBrowser';
my $dir = '/FilesToRead/';
my $fichier;
my $ligne;
my $mimetype;
my @listeFichiers;
my $cgi = CGI -> new();
opendir (DIR, $dir) or die "Impossible d'ouvrir $dir: $!";
@listeFichiers = grep {/\.mem$/ && -f "$dir/$_"} readdir (DIR);
while (my $ouvRep = readdir(DIR))
{
foreach $fichier (@listeFichiers)
{
exec "v-file ./param.par ./Picture/$fichier -PM_overflow 3000000" or die "Script perl ne s'est pas execute";
}
}
closedir DIR;