#!perl -lw
$ENV{HOME}='/'; # avoid trying to read ~/.dpkg.cfg
open FI, "dpkg -l|" or die;
while(<FI>){
    chomp;
    next unless /^ii\s+(\S+)/;
    $_=$1;
    s/:.*//;
    $a{$_}=1;
}
while(<>){
    next if /^\+ /;
    die unless m,^(\S+): /,;
    print $1 unless $a{$1};
}
