|Pathologically Eclectic Rubbish Lister|
Generating a list of numbers from other listsby mlebel (Hermit)
|on Jan 29, 2012 at 14:59 UTC||Need Help??|
mlebel has asked for the
wisdom of the Perl Monks concerning the following question:
I appologies ahead of time if this might seem a bit confusing since it is confusing to me.. feel free to ask for clarifications if i didn't explain myself properly!
So basically, I have a list of numbers (called "NumbersList") which looks like this:
Out of this list of numbers I need to pick out the lines that match the numbers that are inside the next list (called "LookingForTheseNumbersList"). This list looks like this:
The end result of what I am trying to achieve would be a list that would be like this: (printed output)
Now beware that the printed output is simply what i would see on the screen. upon each loop passes, I need to run calculations on each "sections" of numbers. for example, the "20" section, I will need to add up all the numbers to the right of them and print the results, then proceed to adding up all the numbers for the "30" section, so on so forth...
I know I am close but for the life of me, I can't figure out how to make it work...This is what the code that does all the work looks like:
Maybe I am approaching this wrong but I am not advanced in perl enough yet to be able to tell.. any thoughts?