Hi,
I am trying to parse a large text file (10 MB, 400K lines) with the
following code. This is running FreeBSD-Stable (dual proc, 1GB ram),
however I keep receiving messages that I am out of memory, or that the
"query timed out". I need to parse a file with email addresses to sort
out garbage.
How can I do this better?
Thanks in advance,
-Max
#!/usr/bin/perl -w
use Email::Valid;
open (GOOD, ">valid.good") || die "$!";
open (BAD, ">valid.bad") || die "$!";
while (<>) {
if (Email::Valid->address( -address => $_,
-mxcheck => 1,
-fudge => 1 )) {
print GOOD;
} else {
print BAD;
}
}