in reply to Extract part of a list
but read how grep works and you'll probably find more elegant way to do thisuse strict; my @notgood = qw(1 5 6 9); my @goodarray = qw(1 2 3 4 5 6 7 8 9); my @good; foreach my $yes (@goodarray){ if (!grep{$_ == $yes}@notgood){ push @good , $yes; } } print "@good";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Extract part of a list
by blazar (Canon) on Jul 29, 2008 at 08:45 UTC |