in reply to Re^2: Memory Problems with Parsing
in thread Memory Problems with Parsing
I think the problem is that you are misunderstanding how your program moves through your file. $_ only changes when the outer while loop completes.
Consider this code:
while ( <DATA> ) { chomp; until( /[^\d]/ ) { print "$_"; } } __DATA__ 1 A B C
This code will never terminate, it will just print '1' forever. The outer while block never completes and it never sees past the first line returned by the special DATA filehandle.
Try setting a flag to indicate what you should be looking for in your while loop. Use either an if-else chain or a dispatch table to handle each case.
TGI says moo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Memory Problems with Parsing
by phantom20x (Acolyte) on Aug 01, 2007 at 04:44 UTC |