I'm reading a file of 2-3000 lines into an array to process the data in the file. I'm using:
my @fileContents = <$file>
to just dump the whole file into the array. The problem I'm running into is that it appears that perl is breaking it into multiple arrays (two dimensional array) each holding 1000 lines. So when I do something like a for loop:
for(my $x=14; $x<@fileContents; $x++)
to read through each individual line it's only reading the first 999 lines and then stopping (if you are wondering, the data I need to look at starts on line 14). The reason I believe that it is breaking it into two dimensional arrays is because I'm using epic with eclipse and am in debug mode and that's what appears to be happening when I look at the array after the file is read into it.
I was contemplating trying to use:
while(<>) to read everything but I need to start on line 14 or I'm going to get errors.
Any help on this is greatly appreciated. Thank you.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.