sub exclude { my ($a, $b) = @_; for (1..@$a) { my $i = shift @$a; push @$a, $i if ( !grep { $_ eq $i } @$b ); } @$a; }