in reply to exclude all members of @a from @b
Additionally, there's no reason to invoke a regex here when a simple neq would do the job. Something like this would be better:
Of course, with perl, TIMTOWTDI...sub exclude { my ($a, $b) = @_; for (1..@$a) { my $i = shift @$a; push @$a, $i if ( !grep { $_ eq $i } @$b ); } @$a; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: exclude all members of @a from @b
by tomhukins (Curate) on May 13, 2001 at 17:53 UTC |