|
|
| more useful options | |
| PerlMonks |
Re: Parsing CSV only returns the second line of the fileby Athanasius (Vicar) |
| on Sep 01, 2012 at 07:24 UTC ( #991131=note: print w/ replies, xml ) | Need Help?? |
|
Hello saint_geser, and welcome to the Monastery! In addition to the modulus problem highlighted by Anonymous Monk, above (and ignoring the fact that the code snippet you gave doesn’t compile!), there is a problem with the following line:
This occurs within the outer while loop, so on each iteration, whenever the if condition succeeds, the temp file is truncated (“clobbered,” erased) as it is re-opened for output. See open. Move the open statement to before the loop, so it is executed only once. Hope that helps, Athanasius <°(((>< contra mundum
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||