Subject: | Unrecognised line .... Valid.pm |
Running Perl 5.8.0 Email::Valid v 0.15 and Email::Valid::Loose 0.02 on Redhat 9.
Test code:
#!/usr/bin/perl
use strict;
use warnings;
use Email::Valid::Loose;
my ($add, @adds);
my $addrfile = $ARGV[0] || die "filename not given";
open (EMAILS, "$addrfile");
#remove troublesome windows /r characters
#and whitespace
while (<EMAILS>){
chomp $_;
$_ =~ s/\015//;
$_ =~ s/\s//g;
push @adds, $_;
}
close (EMAILS);
foreach $add (@adds){
#if email is invalid move on
if (!defined(Email::Valid::Loose->address($add))){
print $add." is a bad address\n"; #address is bad
}else{
print $add." is a good address\n"; #address is good
}
}
Test file:
user1@foo.com
user2@foo.com
user3@foo.com
The error:
Unrecognised line: user1@foo.com at /usr/lib/perl5/site_perl/5.8.0/Email/Valid.pm line 232
This code does work on Mandrake 8.1 (perl 5.6.1) and Gentoo 1.4 (same versions as above).