1) You need use strict; use warnings;. Each time you go through the loop, you create a new @range_counts. Notice the my within {}. Furthermore, the print uses the global @range_counts, not one of those in which you placed values, since they went out of scope. Put my @range_counts; at the very top.
2) @ranges = ([$i, $j, $k, $m]); create a single element in @ranges. Is that really what you want to do? In your code, $R will always be 0, and for my $R (0..$#ranges) will always loop only once.
3) You spoke of "hash of arrays", yet there are no hashes in that program.
4) I couldn't help but noticing you're reading the same file over and over and over and over again. That's rather innefficient. Especially since you put the contents of the file in an array. Why not populate @file only once?
I can't help you more (and I'm surprised I helped you this much) since you didn't provide a sample input and the desired output for that input.
In reply to Re: folow up to headache with array
by ikegami
in thread folow up to headache with array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |