This is the Perl program which I use to summarise the installed packages for different installations of Caldera OpenLinux.
#!/usr/bin/perl
use IO::File; # Program to produce comparison chart of packages for different COL installs @file=qw(rpm.allpkg rpm.minimum rpm.recommended rpm.busws rpm.devws rpm.home); $numfiles = 6; # open all files, read first line and chomp it, then initialize match array for($i=0;$i<$numfiles;$i++) { $handle[$i] = IO::File->new("< $file[$i]") or die "Can't open $file[$i]: $!\n"; $target[$i]=$handle[$i]->getline(); chomp $target[$i]; $match[$i]=" "; } while ($target[0]) { for($i=1;$i<$numfiles;$i++) { if($target[$i] eq $target[0]) { $match[$i] = " X"; # print "$target[0]: $target[$i], $match[$i] $file[$i]\n"; # Get the next line of the file that matched $target[$i] = $handle[$i]->getline(); chomp $target[$i]; } } # done that row, print a line and then re-initialize the match markers write; for($i=0;$i<$numfiles;$i++) { $match[$i]=" "; } # Do it all over again $target[0] = $handle[0]->getline(); chomp $target[0]; } # close all files for($i=0;$i<$numfiles;$i++) { close $handle[$i]; } format STDOUT = @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<< @<<< @<<< @<<< @<<< $target[0], @match[1..$numfiles] . format STDOUT_TOP = Page @<< $% Package Name Min Rec Busw DevW Home =============================== ==== ==== ==== ==== ==== . Page last updated: 23/Apr/2000 Back to Home Copyright © 1987-2010 Les Bell and Associates Pty Ltd. All rights reserved. webmaster@lesbell.com.au