Is there a better/faster/cheaper way to do this? (I'm sure there is...) I figured it would be built-in somewhere, but couldn't find it, so I wrote it.
sub exclude { ($n, @values) = @_; @array1 = @values[0 .. $n]; @array2 = @values[$n+1 .. $#values]; foreach $entry (@array1) { @array2 = grep(!/^$entry$/, @array2); } return @array2; }
In reply to exclude all members of @a from @b by zane
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |