On Sun, Aug 05, 2001 at 12:56:47PM +0200, Louis wrote:
> Hi,
> 
> If $date is present in my log then I want to add something to the end of 
> the same line. If it is not present I want to insert the date on a new line 
> and add stuff to the end. If present, $date will always be in the last line 
> of the log.

See perldoc -q 'in a file'.  For one thing, you can't mix reading and
writing like this without getting strange results in your file (unless the
file is of a very specific format).  For another, the mode "+>>" sets the
file position to the end of the file, which is almost certainly not what you
intended, because you're reading from the file.  Also, the mode "+>>" means
all writes are to the end of the file, regardless of where the current file
position is.
 

> ### begin code snippet ###
> 
> open (LOGFILE, "+>>$resultlog") || die "cannot open $resultlog\n";
[snip]


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to