I had problems with that line earlier in my adventures.
I noticed that the lines being printed to the output file were off,
I would have data then header instead of header then data
so, I yanked the header and sent it via echo and the data via print 
yes, a ugly hack.. sorry, I am just perl newb at heart


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 18, 2001 2:57 PM
To: [EMAIL PROTECTED]
Subject: Re: REVIEW: please review the following



   212  open(RPT, ">>$REPORT") or die "Can't open $REPORT: $!";
   ...
   221  system "echo \"Starting WKI clone process for $DATE on `date`\" >>
$REPORT";

So you open $REPORT for appending, and then echo into it?  Why open it
in the first place? Also, it seems a bit risky, especially since the
RPT filehandle is not autoflushed. (The $|=1 at the neginning of the
script does this for STDOUT, but not for any filehandle you open.) And
backticks inside a system call is not quite Perlish enough for my
taste.

I would change line 221 to

        print RPT "Starting WKI clone process for $DATE on ",
scalar(localtime), "\n";

And to be tidy:

        close RPT;

when you're done writing to it.

-- tdk

Reply via email to