RE: guestbook eraser
by "Brian A. Sayrs" <sayrs(at)southwindsolutions.com>
|
| Date: |
Fri, 23 Jun 2000 12:38:18 -0700 |
| To: |
"'FODAC(at)aol.com'" <FODAC(at)aol.com>, "hwg-techniques(at)mail.hwg.org" <hwg-techniques(at)mail.hwg.org> |
| |
todo: View
Thread,
Original
|
|
The code you send doesn't really make any sense, but if I understand =
your question you want to append to the file rather than overwrite a =
file. If that's the case you want >> at the start of your filename, =
like this:
open FILEHANDLE, ">>$filename";
Brian A. Sayrs
Owner, Southwind Solutions
-----Original Message-----
From: FODAC(at)aol.com [SMTP:FODAC(at)aol.com]
Sent: Friday, June 23, 2000 4:33 AM
To: hwg-techniques(at)mail.hwg.org
Subject: guestbook eraser
I've got a guest book that erases an old entry when writing to the =
file. How can I write to the file without erasing. Below is the writing =
routine:
open (SAVEFILE,$outputstore);
$num =3D 0;
while (<SAVE7FILE>) {
if ($num <=3D ) {
print NEWFILE $_;
}
++$num;
}
close(SAVEFILE);
close(NEWFILE);
unlink ($outputstore);
}
TIA
Kevin Riggs
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.