in reply to removing elements in array in perl

Hello t-rex,

What you describe is a set difference. For example, using Set::Scalar:

use strict; use warnings; use Set::Scalar; my $a1 = Set::Scalar->new(qw(0 1 2 3 4 5 6 7)); my $a2 = Set::Scalar->new(qw(6 7)); my $diff = $a1->difference($a2); print $diff;

Output:

19:16 >perl 1718_SoPW.pl (0 1 2 3 4 5) 19:16 >

However, you note that your first array is an array of references. So, when you exclude elements from A1 because they also appear in A2, do you want to match the references themselves, or the things they refer to? You will need to be clear on this point before the monks can help you further.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,