Open AlessandroGorohovski opened 7 years ago
I have this problem, too, using Email::Valid->tld
on Debian testing
:
perl -MEmail::Valid -e 'Email::Valid->tld(q{unknown@unknown})'
Use of uninitialized value $tld in hash element at /usr/share/perl5/Email/Valid.pm line 234.
Use of uninitialized value $_[0] in lc at /usr/share/perl5/Net/Domain/TLD.pm line 2033.
Perhaps return 0 unless defined $tld;
or $tld //= q{};
would be appropriate before using the value.
Dear Ricardo,
I found that Email::Valid->address( -address => 'guest@xn--c1ad6a.xn--p1ai', -tldcheck => 1 ); causes warnings in Email::Valid.pm module:
Use of uninitialized value $tld in hash element at /usr/local/share/perl/5.18.2/Email/Valid.pm line 234. Use of uninitialized value $_[0] in lc at /usr/local/share/perl/5.18.2/Net/Domain/TLD.pm line 2033.
I think the problem with line 234:
$ head -n 234 Valid.pm | tail -n 5
due to lack of undef control after my ($tld) = $host =~ m#.(\w+)$#.
Regards, Alessandro