mhoang has asked for the wisdom of the Perl Monks concerning the following question:
I write the script to generate the report, I need to add data to the file,and create the heading if it is a new page. I donot know why it keeps addding the heading to the file every time I run the script.I do not know what is wrong with my script, pls help me, thanks
if($status == 0) { $Msg=<<MSG; Copy is successful!!! MSG sendAdminMessage($Msg, \@emailAddressAdmins); #Generate the log file open(OUTFILE, ">>$outputFile") || die "Unable to open file[$outputFile +] for writing: $!\n"; $| = 1; # Auto-flush output = on print "page number [$=]\n"; write OUTFILE; close OUTFILE; # Output formatting: ========================================================= format OUTFILE_TOP = Staff Extra Bulletin Log Pg @<< $% Filename Last-Updated Current ====================================================== . format OUTFILE = @<<<<<<<<<<<<< @<<<<<<< @<<<<<<<< $fileone,$oldTime,$newTime . + } else { exit(0); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: append text to a file
by cdarke (Prior) on Aug 04, 2011 at 07:29 UTC | |
by mhoang (Acolyte) on Aug 08, 2011 at 00:35 UTC | |
|
Re: append text to a file
by Marshall (Canon) on Aug 05, 2011 at 14:09 UTC |