hotshot has asked for the wisdom of the Perl Monks concerning the following question:
I want to stay with stay with the entries in @arr2 that their prefix is the digits from @arr1:# if I have: my @arr1 = qw(2 4 5); my @arr2 = ('1,nfs', '2,afp', '3,cifs', '4,dns', '5,backup');
what is the shortest way?# therefore from the above arrays I want to get: @arr3 = qw(afp dns backup);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: stripping an array
by merlyn (Sage) on Jan 02, 2003 at 18:09 UTC | |
by jdporter (Paladin) on Jan 02, 2003 at 18:33 UTC | |
|
Re: stripping an array
by broquaint (Abbot) on Jan 02, 2003 at 18:44 UTC | |
|
Re: stripping an array
by Juerd (Abbot) on Jan 02, 2003 at 18:13 UTC | |
by steves (Curate) on Jan 02, 2003 at 18:19 UTC | |
by jdporter (Paladin) on Jan 02, 2003 at 18:22 UTC | |
|
Re: stripping an array
by FamousLongAgo (Friar) on Jan 02, 2003 at 18:15 UTC |