|
|
| Think about Loose Coupling | |
| PerlMonks |
Re: Strange output problemby Lotus1 (Hermit) |
| on Apr 12, 2012 at 17:59 UTC ( #964801=note: print w/ replies, xml ) | Need Help?? |
|
I noticed that you re-open the same file from $out_file as $new_in_file without closing $out_file first. Seems like buffering could be an issue here. I tried your program with a smaller number of rows and columns and found that with the close statement before the reopen I got output in the final processed file and without it I got a blank file. The intermediary file looked good in both cases. Maybe the final data to the intermediary gets written when the program ends and that first file handle is closed. I don't want to troubleshoot much here until you have a look at using close. Update: I thought of an easy way to test my idea about buffering. I made a copy of the intermediary file then closed the intermediary file then made another copy. The first copy was empty the second had everything in it.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||