I took the open through the close and ran the script and each time, it added 
another line to the file.

        Running AS 5.6.0 Build 623 on w2k.

Wags ;)

-----Original Message-----
From: Chris Zampese [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 15:05
To: [EMAIL PROTECTED]
Subject: file question


Hi everyone,
     I thought that the folowing code should save the data to the file, and then when 
it was run again it should save the new data on a newline in the same file.  It saved 
the data once, but it will not repeat the feat.  The data comes from a form, and I use 
it to generate an email (which works)
I expected the file to look like this...
    Placing_Slip_123_456_SOMECOMPANY+09-02-2002
    Placing_Slip_890_777_SOMEOTHERCOMPANY+09-02-2002
 etc, but I only get the first line.

#!C:\Perl\bin\perl.exe -w
#By Chris Zampese   
#use strict;
use CGI ':standard';
use Net::SMTP;
use LWP::Simple;

# some code here that gets stuff from form and creates an email using NET::SMTP

open(MYFILE, "+>> C:/sentslips/sentslips.txt")
       || die "can't open C:/sentslips/sentslips.txt";

print {MYFILE} "Placing_Slip_";
print {MYFILE} $clientno;
print {MYFILE} "_";
print {MYFILE} $policyno;
print {MYFILE} "_";
print {MYFILE} $underwriter;
print {MYFILE} "+";
print {MYFILE} $dates;
print {MYFILE} "\n";

close (MYFILE);

Thanks once again,
                   Chris.

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

Reply via email to