Hello all !I have two sets of folders that have IP address from two sources.The below perl script I was working with needs some corrections.I am looking for the perl script to identify and count what IP address are found to be duplicated between both files.The format from both files are the same meaning IP addresses100.100.100.2
I am hopefull to get a report like so:
The report should contain a list of objects found in both datasets. For example:
"The following objects were found in both file A and File B:
10.1.1.1
10.2.2.1
With what I have I noticeing an error off the bat. Mind you I am not an expert in perl
syntax error at E:\dup2.pl line 10, near "print"Execution of E:\dup2.pl aborted due to compilation errors.
Thanks
#!perl
@ARGV=<E://rich//file-A-obj_prof.out.txt E://rich2//File-B-obj_prof-out.txt *>;
while( <> ){
next if /^#/;
print if $count{(split)[-1]}{$ARGV}++;
}
my %in;
push @{$in{join' and ',sort keys %{$count{$_}}}},$_ for sort grep{%{$count{$}} > 1} keys %count
print join"\n","the following files appear in $_",@{$in{$}},"" for keys %in;