in reply to Re: Re: How to look for exact pattern match
in thread How to look for exact pattern match
You're not removing the elements, you're replacing them with spaces.
I think you want this, then:
my @in = qw(bga cbga test); my @out = @in; my @test = qw(bga); foreach my $test (@test) { @out = grep { $_ ne $test } @out; }
Which leave @out contains all the elements from @in that don't exist in @test.
Actually, thinking about it, that's the disjunction of two sets and there's probably some really short recipe to do it in the Cookbook.
--"The first rule of Perl club is you don't talk about Perl club."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: How to look for exact pattern match
by clintp (Curate) on Oct 30, 2001 at 18:03 UTC | |
|
FAQ, not Cookbook.
by Fletch (Bishop) on Oct 30, 2001 at 16:56 UTC |