Syntactic Confectionery Delight | |
PerlMonks |
Re^3: Splitting a text fileby Ratazong (Monsignor) |
on Mar 20, 2013 at 08:06 UTC ( [id://1024470]=note: print w/replies, xml ) | Need Help?? |
Hi Dr Manhattan, have a look at the difference between my algorithm and your solution: you open the file in each iteration of the loop. And by opening a file for writing, you erase the previous content. The solution is to open the file before the loop. And (additionally) inside the if-block, when you want to switch to the next file. HTH, Rata
In Section
Seekers of Perl Wisdom
|
|