vivin has asked for the wisdom of the Perl Monks concerning the following question:
I have another array with the following:apple chocolate ice-cream apple chocolate pie apple chocolate custard apple caramel ice-cream apple caramel pie apple caramel custard apple vanilla ice-cream apple vanilla pie apple vanilla custard banana chocolate ice-cream banana chocolate pie banana chocolate custard banana caramel ice-cream banana caramel pie banana caramel custard banana vanilla ice-cream banana vanilla pie banana vanilla custard orange chocolate ice-cream orange chocolate pie orange chocolate custard orange caramel ice-cream orange caramel pie orange caramel custard orange vanilla ice-cream orange vanilla pie orange vanilla custard
What I'm trying to do is remove all items present in the second array, from the first array. To do that, I have this line of code:apple chocolate pie apple caramel custard banana caramel ice-cream orange vanilla pie
Why is this happening?@yum = grep {!/apple chocolate pie/} @yum; @yum = grep {!/apple caramel custard/} @yum; @yum = grep {!/banana caramel ice-cream/} @yum; @yum = grep {!/orange vanilla pie/} @yum;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Map not working as expected.
by chromatic (Archbishop) on May 04, 2007 at 20:19 UTC | |
|
Re: Map not working as expected.
by shigetsu (Hermit) on May 04, 2007 at 21:13 UTC | |
|
Re: Map not working as expected.
by pileofrogs (Priest) on May 04, 2007 at 21:24 UTC | |
by Anonymous Monk on May 06, 2007 at 08:03 UTC |