#!/usr/bin/perl use strict; use warnings; use diagnostics; use List::Compare; my @List1 = qw(education production results); my @List2 = qw(education joe bob carl production steve results test); my @OutList1 = @List1; #Part I is done... my $lc = List::Compare->new(\@List1, \@List2); # Get those items which appear (at least once) only in the second list. my @OutList2 = $lc->get_complement; my $n; foreach (@OutList2) {print $n++.": $_\n"};