ajguitarmaniac has asked for the wisdom of the Perl Monks concerning the following question:
Greetings Monks! This one sounds real simple but for some reason I'm having a hell of a time figuring it out! Here goes.. I have 2 arrays, say
my @arr1 = ('1','2','3','4','5','6','7','8','9'); my @arr2 = ('1','4','5','9','7');
I need to pick out those elements that are found in @arr1 but not in @arr2 and store them into another array(say @arr3) and print the values consequently.It must be noted that elements in @arr2 will for sure exist in @arr1. Help me out Monks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array comparison using perl
by Khen1950fx (Canon) on Dec 21, 2010 at 08:37 UTC | |
by ajguitarmaniac (Sexton) on Dec 21, 2010 at 12:03 UTC | |
|
Re: Array comparison using perl
by fisher (Priest) on Dec 21, 2010 at 11:34 UTC | |
by GrandFather (Saint) on Dec 21, 2010 at 20:18 UTC | |
by ajguitarmaniac (Sexton) on Dec 21, 2010 at 14:54 UTC | |
|
Re: Array comparison using perl
by samarzone (Pilgrim) on Dec 21, 2010 at 08:20 UTC |