aSDDSasdas
Programmer
Hello ,
i have this program for which i do not know yet where exactly the problem is . i guess it is something to do in defining a variable or maybe with my arguments which are defined maybe in a proper manner . would be gratefull for any advice
compare1.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;
................................................................
test.pl
#!/usr/bin/perl
use strict;
use warnings;
system("/home/compare1.pl","/home/update_0609041028.txt","/home/update_0609041042.txt");
Note :i have eliminated the subroutines.
and line 66 is pen my $txt1,"< $filename1" or die "cant open $filename1 for reading $!"
i have this program for which i do not know yet where exactly the problem is . i guess it is something to do in defining a variable or maybe with my arguments which are defined maybe in a proper manner . would be gratefull for any advice
compare1.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;
................................................................
test.pl
#!/usr/bin/perl
use strict;
use warnings;
system("/home/compare1.pl","/home/update_0609041028.txt","/home/update_0609041042.txt");
Note :i have eliminated the subroutines.
and line 66 is pen my $txt1,"< $filename1" or die "cant open $filename1 for reading $!"