I want to run something like this for many different types of lists. Do I
need to call flock on my majordomo list files to avoid corruption. What
happens when I lock the file and majordomo attempts to write to it?
ramon.
On Mon, 7 Feb 2000, Jack Schnapper wrote:
> I am rather a neophyte when it comes to perl. Where would I insert this
> module?
>
> Thanks,
> Jack
>
> At 05:47 PM 2/4/00 -0800, Clay Irving wrote:
>
> >On Fri, Feb 04, 2000 at 01:47:35PM -0800, ramon via lepton wrote:
> >
> >> Does anyone have a working email validator for majordomo lists?
> >
> >I use the Perl module Email::Valid to weed out obvious bad addresses:
> >
> >#!/usr/local/bin/perl
> >
> >use Email::Valid;
> >
> >$input_file = "foo.txt"; # Input file
> >$good_addresses = "good.txt"; # File to store good addresses
> >$bad_addresses = "bad.txt"; # File to store bad addresses
> >
> >open F, "$input_file" or die "$!\n";
> >open G, ">$good_addresses" or die "$!\n";
> >open R, ">$bad_addresses" or die "$!\n";
> >
> >while ($address = <F>) { # Read the list of Email addresses
> > chomp $address;
> > $address =~ s/^\s+//; # Remove spaces in the Email address
> > $valid = new Email::Valid;
> > if ($valid->address( -address => $address)) {
> > print G "$address\n"; # The address is valid
> > } else {
> > print R "$address\n"; # the address is not valid
> > }
> >}
> >
> >--
> >Clay Irving
> >clay@skechers.com
>
Follow-Ups:
References:
|
|