Revered monks,
I am trying to compare 2 simple arrays @file and @file2.
After the comparision I need:
I am using the following code... Is this the best way of doin it??? is there a optimization or even a direct function for this?
%seen = (); @seen{ @file1 } = (); @infile1only = grep { ! exists $seen{$_} } @file2; %seen =(); @seen{ @file2 } = (); @infile2only = grep { ! exists $seen{$_} } @file1; @matched = grep { exists $seen{$_} } @file1;
thanks,
narashima
In reply to optimal way of comparing 2 arrays by narashima
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |