cuautemoc has asked for the wisdom of the Perl Monks concerning the following question:
I have a question about a nested loop I'm having trouble with. I'm reading in a list in the following format:
What I'm trying to do is use a nested foreach loop to peel off the first four elements, then parse those four elements into four new arrays. Here is my code:
I get the error "Use of implicit split to @_ is deprecated at filename.pl." I thought I was assigning the first split to $list, not $_. Can someone point out where I'm going wrong? What I'm hoping to get is pull each name(x) from the array, and store to it's own array, each a(x) to it's own array, and so forth.foreach(@array1) { $list=split(/,/,@array1,4); foreach($list) { (@w,@x,@y,@z)=split(/ /,$list,1);} }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Nested Loop Problems
by brx (Pilgrim) on May 02, 2012 at 20:11 UTC | |
by cuautemoc (Initiate) on May 02, 2012 at 22:15 UTC | |
by brx (Pilgrim) on May 03, 2012 at 07:44 UTC | |
|
Re: Nested Loop Problems
by ww (Archbishop) on May 02, 2012 at 20:46 UTC | |
|
Re: Nested Loop Problems
by furry_marmot (Pilgrim) on May 02, 2012 at 21:10 UTC | |
|
Re: Nested Loop Problems
by johngg (Canon) on May 02, 2012 at 21:33 UTC |