I’m coding a perl script that audits a library and compares the list of installed software with a list from another machine to ensure that they are working off of the same stuff. I’ve taken the raw data and placed it into two, 2-dimensional arrays of size Nx4 where N is the number of software titles. For example:
[Fileset1], [1.0.2.3], [COMMITTED], [Description of file]
[Fileset2], [2.4.2.2], [COMMITTED], [Description of a different file]
....
I now need to compare the two lists to find discrepancies, whether they be missing files of level differences. Not being a perl pro yet, the only way I can conceive of doing this is to compare each element of the first array against each element of the other array to look first for matching filesets with different levels or no matching filesets at all. The I would have to repeat the process with the other list to ensure that I’d found all possible differences. Obviously with this procedure I’m looking at efficiency of greater than n^2. I was wondering if there was some application of grep that I could make use of or something similar to avoid this when comparing libraries with upwards of 20,000 entries.
In short, I need to compare two 2 dimensional arrays and keep track of the differences for each list, instead of merely finding the intersection of the two.
Thanks in advance for the help!
The output is a little unwieldy, but I like
Data::Difffor tasks like this:Result: