Syntactic Confectionery Delight | |
PerlMonks |
Re^3: Only last record is written to the output file instead of all recordsby davido (Cardinal) |
on Nov 17, 2008 at 07:29 UTC ( [id://724014]=note: print w/replies, xml ) | Need Help?? |
Test for the condition prior to entering the loop, OR, open within the loop, but on each iteration check to see if the file is already open. Easy way to do that would be to use a lexical filehandle, scoped to just outside the loop. Here's an example:
Dave
In Section
Seekers of Perl Wisdom
|
|