I would like to run a perl script within another perl scirpt. The second perl script parses out data. When i use the print command it works fine, however when i use the perl script i get an error ===> Error cannot open: No such file or directory. what am i doing wrong.
thanks in advance!
#!/usr/bin/perl -w
my $source_dir = "/usr/local/sysadm/logs/monitor/carolina/cgt";
my $perl_dir = "/usr/local/sysadm/logs/monitor/carolina/";
opendir( DIR, $source_dir ) || die "Can't open files_out/o directory\n";
local( @filenames ) = readdir( DIR );
closedir( DIR ) || die "Can't close directory\n";
print "Original files:\n";
foreach $filename ( @filenames )
{
next if ($filename =~ m/^\./);
#print "$filename\n";
system( "$perl_dir/pro-monitorcsv.pl $filename" ) ;
}
thanks in advance!
#!/usr/bin/perl -w
my $source_dir = "/usr/local/sysadm/logs/monitor/carolina/cgt";
my $perl_dir = "/usr/local/sysadm/logs/monitor/carolina/";
opendir( DIR, $source_dir ) || die "Can't open files_out/o directory\n";
local( @filenames ) = readdir( DIR );
closedir( DIR ) || die "Can't close directory\n";
print "Original files:\n";
foreach $filename ( @filenames )
{
next if ($filename =~ m/^\./);
#print "$filename\n";
system( "$perl_dir/pro-monitorcsv.pl $filename" ) ;
}