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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: exclude all members of @a from @b
by Beatnik (Parson) on May 13, 2001 at 20:42 UTC | |
|
Re: exclude all members of @a from @b
by Masem (Monsignor) on May 13, 2001 at 16:00 UTC | |
by tomhukins (Curate) on May 13, 2001 at 17:53 UTC | |
|
Re: exclude all members of @a from @b
by merlyn (Sage) on May 13, 2001 at 20:49 UTC |