in reply to Comparing Version Numbers

Well, if you can guarantee that LIST 2's packages will always be later than LIST 1's, you might be able to do this:
# # build some lists for testing purposes... # my @current = qw ( zip-2.3.1-14 xpdf-1.01-8 ggv-1.99.8-2 libpng-devel-1.2.2-8 xvattr-1.3-ogle1 ); my @updates = qw ( WindowMaker-0.80.1-5 lynx-2.8.5-7.1 xpdf-1.01-10 ggv-1.99.9-5 xvattr-1.4-ogle1 libpng-devel-1.2.2-9 ); # # Ok, here's the real code snippet. # my %one; my %two; foreach ( @current, @updates ) { if (/^(\w+)-/) { $two{$_}++ if $one{$1}; $one{$1}++; } } print join( "\n", sort keys %two );

Output:
C:\Perl\bin>perl upgrade.pl
ggv-1.99.9-5
libpng-devel-1.2.2-9
xpdf-1.01-10
xvattr-1.4-ogle1

Rob