Hello ,
I am having a Problem in calling another Script and i do not know where exactly the problem is .
I have Two scrips :
file.pl and system.pl
#!/usr/bin/perl
use strict;
use warnings;
# initialise
my %diff ;
my %diff1 ;
my %diff2 ;
my ($filename1, $filename2) = @ARGV;
@ARGV=2 or die "Usage : There should be 2 arguments";
open my $txt1,"< $filename1" or die "cant open '$filename1' for reading $!";
open my $txt2,"< $filename2" or die "Cant open '$filename2' for reading $!";
open my $txt3,"> added.txt" or die "cant open added.txt for reading $!";
open my $txt4,"> deleted.txt"or die "Cant open deleted.txt for reading $!";
open my $txt5,"> common.txt" or die "cant open common.txt for reading $!";
# create a hash table
while (<$txt2>)
{
$diff{strip($_)} = 1;
}
# extract added/deleted values
while(<$txt1>)
{
print $txt3 $_ unless (check_content($_) || !(eliminate(strip($_))));
}
close $txt1;
close $txt2;
close $txt3;
# extract added/deleted values
open my $txt8,"<".$filename1 or die "cant open $filename1 for reading $!";
open my $txt9,"<".$filename2 or die "Cant open $filename2 for reading $!";
while (<$txt8>)
{
$diff1{strip($_)} = 1;
}
while(<$txt9>)
{
print $txt4 $_ unless (check_content1($_) || !(eliminate(strip($_))));
}
close $txt8;
close $txt9;
close $txt4;
System.pl
#!/usr/bin/perl
use strict;
use warnings;
system('compare.pl','update_060904.txt','update_060905.txt')
The Program file.pl works out fine when it is executed seperately.However when it is called through another script i get an error saying
Cant exec "compare.pl" : No such file or directory at file.pl,line 6 (which is :system('compare.pl','update_060904.txt','update_060905.txt'))
would be gratefull for any advice
Laveena
I am having a Problem in calling another Script and i do not know where exactly the problem is .
I have Two scrips :
file.pl and system.pl
#!/usr/bin/perl
use strict;
use warnings;
# initialise
my %diff ;
my %diff1 ;
my %diff2 ;
my ($filename1, $filename2) = @ARGV;
@ARGV=2 or die "Usage : There should be 2 arguments";
open my $txt1,"< $filename1" or die "cant open '$filename1' for reading $!";
open my $txt2,"< $filename2" or die "Cant open '$filename2' for reading $!";
open my $txt3,"> added.txt" or die "cant open added.txt for reading $!";
open my $txt4,"> deleted.txt"or die "Cant open deleted.txt for reading $!";
open my $txt5,"> common.txt" or die "cant open common.txt for reading $!";
# create a hash table
while (<$txt2>)
{
$diff{strip($_)} = 1;
}
# extract added/deleted values
while(<$txt1>)
{
print $txt3 $_ unless (check_content($_) || !(eliminate(strip($_))));
}
close $txt1;
close $txt2;
close $txt3;
# extract added/deleted values
open my $txt8,"<".$filename1 or die "cant open $filename1 for reading $!";
open my $txt9,"<".$filename2 or die "Cant open $filename2 for reading $!";
while (<$txt8>)
{
$diff1{strip($_)} = 1;
}
while(<$txt9>)
{
print $txt4 $_ unless (check_content1($_) || !(eliminate(strip($_))));
}
close $txt8;
close $txt9;
close $txt4;
System.pl
#!/usr/bin/perl
use strict;
use warnings;
system('compare.pl','update_060904.txt','update_060905.txt')
The Program file.pl works out fine when it is executed seperately.However when it is called through another script i get an error saying
Cant exec "compare.pl" : No such file or directory at file.pl,line 6 (which is :system('compare.pl','update_060904.txt','update_060905.txt'))
would be gratefull for any advice
Laveena