On 6/14/05, Karyn Williams <[EMAIL PROTECTED]> wrote: > Below is code that I found on the web that I slightly modified. I am trying > to create a script to remove from a file (tlist) the items in another file > (tnames). This works but I have multiple files (tlist) I need to check > against. I'm not sure how/where to put the loop and would appreciate any > help. I am also wondering why the hash ? Does it work better in the script > than an array and what are the keys in this case as the files (both) are > just lists of e-mail addresses.
If you're not set on using perl for all of this, grep (if available) can do a lot of the work for you: # create fake suppression lists > perl -e 'print "[EMAIL PROTECTED]" for "d" .. "p";' > exclude1 > perl -e 'print "[EMAIL PROTECTED]" for "C" .. "F";' > exclude2 # create fake email list perl -e 'print "[EMAIL PROTECTED]" for "a" .. "z", "A" .. "Z";' > source # print emails in the list not in either suppression list grep -f exclude1 -f exclude2 -v source -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>