Or perhaps more simplyuse Quantum::Superpositions; my @array1 = qw( 1 83 90 120 140 300 ); my @array2 = qw( 83 140 ); my @filtered = grep all(@array2) != $_, @array1;
foreach my $i (0 .. $#array1) { $array1[$i] == $_ and delete $array1[$i] foreach @array2; } my @filtered = grep defined, @array1;
_________
broquaint
In reply to Re: subtract one array from another
by broquaint
in thread subtract one array from another
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |