Re: simple file question

2002-01-30 Thread Roger C Haslock
An alternative might be a tied hash, where the key is the email address. - Roger - - Original Message - From: "Chris Zampese" <[EMAIL PROTECTED]> To: "perl list" <[EMAIL PROTECTED]> Sent: Wednesday, January 30, 2002 2:10 AM Subject: simple file questi

Re: simple file question

2002-01-29 Thread Deen Hameed
while ( ) { push(@new_names, $_) unless ($_ eq $myvar); } # now you have a list of new names you can append to the file open(FILEHANDLE, ">>somefile.txt"); print FILEHANDLE join("\n", @new_names); close FILEHANDLE; deen On Wed, 30 Jan 2002, Chris Zampese wrote: > Hello eve

Re: simple file question

2002-01-29 Thread Tanton Gibbs
BTW, I forgot a chomp... while( ) { chomp; ... same as before... } - Original Message - From: "Tanton Gibbs" <[EMAIL PROTECTED]> To: "Chris Zampese" <[EMAIL PROTECTED]>; "perl list" <[EMAIL PROTECTED]> Sent: Tuesday, January 29

Re: simple file question

2002-01-29 Thread John W. Krahn
Chris Zampese wrote: > > Hello everyone, Hello, >I have a variable $myvar (an email address), and > I would like to open a simple text file which contains > email addresses (one on each line) and check to see if > the address in $myvar is in there, if it is not, then > append it o the end o

RE: simple file question

2002-01-29 Thread McDonald Patrick
Write your print statement like this if /$email2/o { print FILE2; } -Original Message- From: Chris Zampese [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 9:18 PM To: perl list Subject: Re: simple file question Just found a regex in the docs. I now have this... while

Re: simple file question

2002-01-29 Thread Tanton Gibbs
- From: "Chris Zampese" <[EMAIL PROTECTED]> To: "perl list" <[EMAIL PROTECTED]> Sent: Tuesday, January 29, 2002 9:10 PM Subject: simple file question Hello everyone, I have a variable $myvar (an email address), and I would like to open a simple text file which contains

Re: simple file question

2002-01-29 Thread Chris Zampese
t: Wednesday, January 30, 2002 3:10 PM Subject: simple file question Hello everyone, I have a variable $myvar (an email address), and I would like to open a simple text file which contains email addresses (one on each line) and check to see if the address in $myvar is in there, if it is not,

simple file question

2002-01-29 Thread Chris Zampese
Hello everyone, I have a variable $myvar (an email address), and I would like to open a simple text file which contains email addresses (one on each line) and check to see if the address in $myvar is in there, if it is not, then append it o the end of the file, and if it is, then close the f