M
M.L.
Given an array: @planets = qw(mercury venus earth mars jupiter saturn uranus
neptune pluto);
and @removes = qw(venus mars pluto);
I'd like to know how to grep the @removes from @planets such that
@planets = qw(mercury earth jupiter saturn uranus neptune);
I tried
@planets = grep (!/$removes[0..$#removes]/, @planets);
but that didn't work and I'm out of ideas. Any assistance appreciated.
Thanks.
neptune pluto);
and @removes = qw(venus mars pluto);
I'd like to know how to grep the @removes from @planets such that
@planets = qw(mercury earth jupiter saturn uranus neptune);
I tried
@planets = grep (!/$removes[0..$#removes]/, @planets);
but that didn't work and I'm out of ideas. Any assistance appreciated.
Thanks.