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
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
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
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
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
-
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
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,
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