Hi,
I'm trying to maintain a log file. Actually I thought it was working fine but there is a little problem:
Each time the script writes to the file it continues on the same line while it should start at a new line.
This is the piece of script that I use:
$download_log = $ENV{'DOCUMENT_ROOT'} . 'download_log.txt';
open (EMAIL_FILE, ">> $download_log"
or &error("Could not open data file at line ", __LINE__);
flock EMAIL_FILE, 2 or &error("Could not lock data file at line ", __LINE__);
print EMAIL_FILE $SHORTDATE . " | " . $Name . " | " . $Email . " | " . $occup . " | " . $Country;
close EMAIL_FILE;
flock EMAIL_FILE, 8;
Can anybody tell me what I have to add to the script to start at a new line when it writes to the file?
I guess this is very simple to solve but I don't know how!
Thanks,
raoul
I'm trying to maintain a log file. Actually I thought it was working fine but there is a little problem:
Each time the script writes to the file it continues on the same line while it should start at a new line.
This is the piece of script that I use:
$download_log = $ENV{'DOCUMENT_ROOT'} . 'download_log.txt';
open (EMAIL_FILE, ">> $download_log"
flock EMAIL_FILE, 2 or &error("Could not lock data file at line ", __LINE__);
print EMAIL_FILE $SHORTDATE . " | " . $Name . " | " . $Email . " | " . $occup . " | " . $Country;
close EMAIL_FILE;
flock EMAIL_FILE, 8;
Can anybody tell me what I have to add to the script to start at a new line when it writes to the file?
I guess this is very simple to solve but I don't know how!
Thanks,
raoul