Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
... in which case the immediate solution to the problem is to:
immediately before the inner while loop (see seek). To the OP: But reading the same input file multiple times is a poor design. Reading from disk is order(s) of magnitude more expensive than reading from RAM. Much better to read the file once, storing its data in a suitable data structure, and then iterate over that data structure as needed. BTW, some consistent indentation would go a lo-o-ong way towards making the code more readable (and the problem more tractable). Hope that helps,
In reply to Re^2: Foreach/While - Why does this run AFTER that?
by Athanasius
|
|