in reply to array difference

Yet another way, using List::Compare:

use strict; use warnings; use List::Compare; my @a = (1, 2, 3, 4, 5, 6); my @b = ( 3, 4 , 5, 6, 7, 8); my $lc = List::Compare->new( \@a, \@b ); my @a_only = $lc->get_Lonly; my @b_only = $lc->get_Ronly; print join( ', ', @a_only ), "\n"; # 1, 2 print join( ', ', @b_only ), "\n"; # 7, 8

This type of question is asked frequently. You can SuperSearch for other threads, such as most efficient way to implement "A without B", and search CPAN for modules in the List:: namespace.

HTH