Sorry, I forgot to include a snippet because my wife was rushing me out the door. ;-) No, I'm not reading the whole file into an array; I'm using scalar context to read in one line at a time:
...
open (INPUTFILE, $inputfile) or die ("\nERROR: Unable to open file
+\"$inputfile\".\n");
while (!eof(INPUTFILE))
{
$line = readline(INPUTFILE);
...
And that's where it chokes. If I insert a print statement before and after the readline (as checkpoints), the first one will work, and the second one will not.
I don't have experience using read, and when I tried replacing the readline with a simple read earlier, It looked like the same hang was happening. However, when I tried it again just now, it worked fine:
read(INPUTFILE, $x, 1);
Since I knew (from MUCH smaller files) that the input files would have chunks of chr(0) at the front, I wrote a bit of code around the read statement above to see just how bad the situation is for this particularly large file. As I write this message, we're at 120MB worth of continuous chr(0) and counting...
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.