Hi,
if you open your outputfile like
open(FH, ">>", $file)
you will append all the stuff to the file. Probably you want to
replace your file if you run your script again.
open(FH, ">", $file)
HTH, Martin
On Mon, 27 Aug 2007 22:53:16 +0530
"Mihir Kamdar" <[EMAIL PROTECTED]> wrote:
> Hi Chas,
>
> It works...but the problem I have is that some of the records are totally
> lost. And also the output file keeps on writing multiple times and grows
> into a huge size. almost 10 times, it keeps on growing until I kill the
> script.
>
> I checked few of the records which have calculated properly and giving me
> the desired result, while the others are totally lost in the output. Check
> my code after closing the file. Is it the culprit?
>
> close $IN_FILE ;
>
> open (my $OUT_FILE,">>","$write_path/$file.out") or
> die $!;
>
> while (my($key, $value) = each %hash)
> {
> print $OUT_FILE $value;
> }
> close $OUT_FILE ;
> }
> }
> closedir $dh ;
> }
>
>
> Thanks..
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/