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 (<FILE2>) { print if /$email2/o; } but I am still not sure how to print to the file?? ----- Original Message ----- From: "Chris Zampese" <[EMAIL PROTECTED]> To: "perl list" <[EMAIL PROTECTED]> Sent: 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, then append it o the end of the file, and if it is, then close the file and carry on with the rest of the script. I have tried using while (<FILEHANDLE>){}, but I am not really sure what to put in the brackets? Thanks as always, Chris. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]