JockoHelios has asked for the wisdom of the Perl Monks concerning the following question:
The original post, with demo code and my confusion both in full display, are here http://www.perlmonks.org/?node_id=1039251
I have a large array of arrays, the original data. When going through that data, serially, at each row I need to check back over the previous 15 rows to see if a value exists in a specified field of those previous rows. Call it a look-back. The value I'm looking for can change based on the values in the current row, so this has to be evaulated with every original data row.I decided to populate a look-back array with rows from the original data. This would be the 15 previous rows. The flow concept goes like this:
run through the original data via foreach. For every original data row :The look-back array would thus always have the previous 15 rows, based on the current original data row.
Where I'm stuck is at the look-back array. I'm unable to come up with the code to pull out a specified field from each row of the look-back array (of arrays). I've tried several methods to get the original data rows into the look-back array, and more methods to pull the specified element from it, but all I've gotten are error messages. Am I pounding my head against the wall here ? Is this flow concept so far off the mark that it can't be done ?I had considered setting up a loop with a counter to go through the original data, and using that counter to look back over the last 15 rows. That seems clumsy to me, but maybe in this case ! TMTOWTDI...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array of arrays - redux
by BrowserUk (Patriarch) on Jun 17, 2013 at 16:03 UTC | |
by JockoHelios (Scribe) on Jun 17, 2013 at 17:46 UTC | |
by BrowserUk (Patriarch) on Jun 17, 2013 at 17:53 UTC | |
|
Re: Array of arrays - redux
by hdb (Monsignor) on Jun 17, 2013 at 16:03 UTC | |
by JockoHelios (Scribe) on Jun 17, 2013 at 17:37 UTC | |
|
Re: Array of arrays - redux
by space_monk (Chaplain) on Jun 17, 2013 at 16:07 UTC | |
by JockoHelios (Scribe) on Jun 17, 2013 at 17:43 UTC | |
|
Re: Array of arrays - redux
by poj (Abbot) on Jun 17, 2013 at 16:40 UTC | |
by JockoHelios (Scribe) on Jun 17, 2013 at 18:00 UTC | |
|
Re: Array of arrays - redux
by Anonymous Monk on Jun 17, 2013 at 18:17 UTC | |
|
Re: Array of arrays - redux
by space_monk (Chaplain) on Jun 18, 2013 at 11:26 UTC |