my %h1 = map { /^\w+\s+\w+\s+(\w+)/ ; ( $1, 1) } @list_one; push @list_one, grep { /^\w+\s+\w+\s+(\w+)/; ! exists $h1{$1} } @list_two;