my @new = `cat /path/to/some/file`; foreach my $new (@new) { my $args = `rpm -qa | grep $new`; print $new if ($args =~ m/^$/); }