R
Rocky Allen
Hey Y'all
I have been trying to find the most effective way to compare the values in
two arrays. The idea is to match the list of files sent into cpio vs. the
files that actually made it onto the tape. I have been looking at
Array::Compare, but the example in cpan is broken. Does anyone know the
best way to compare two arrays?
thanks,
Rocky
#!/usr/bin/perl
use strict;
use warnings;
my @posttape;
open FH3, '</tmp/cpioin' or die "Cannot open /tmp/cpioin: $!";
my @pretape = <FH3>;
open IN, '<', '/tmp/filesontape' or die "Cannot open /tmp/filesontape: $!";
while ( <IN> ) {
my @fields = split;
push @posttape, "$fields[8]\n";
}
close IN;
open(FH5, '>/tmp/ontape') or die "no FH5:$!";
print FH5 @posttape;
I have been trying to find the most effective way to compare the values in
two arrays. The idea is to match the list of files sent into cpio vs. the
files that actually made it onto the tape. I have been looking at
Array::Compare, but the example in cpan is broken. Does anyone know the
best way to compare two arrays?
thanks,
Rocky
#!/usr/bin/perl
use strict;
use warnings;
my @posttape;
open FH3, '</tmp/cpioin' or die "Cannot open /tmp/cpioin: $!";
my @pretape = <FH3>;
open IN, '<', '/tmp/filesontape' or die "Cannot open /tmp/filesontape: $!";
while ( <IN> ) {
my @fields = split;
push @posttape, "$fields[8]\n";
}
close IN;
open(FH5, '>/tmp/ontape') or die "no FH5:$!";
print FH5 @posttape;