Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Email-Valid CPAN distribution.

Report information
The Basics
Id: 18226
Status: resolved
Priority: 0/
Queue: Email-Valid

People
Owner: Nobody in particular
Requestors: fred [...] acheiversintlinc.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.15
Fixed in: (no value)



Subject: tldcheck not compatible with current Net::Domain::TLD (1.65 25 Jan 2006)
Email::Valid->address( -address => $testmail, -tldcheck => 1 ); gives error: Can't locate object method "new" via package "Net::Domain::TLD" This module's code for Net::Domain::TLD must be for an older version. Current code in Valid.pm ================== Line 20: $TLD = Net::Domain::TLD->new if defined $Net::Domain::TLD::VERSION; Lines 167 - 174: if (!defined $TLD) { require Net::Domain::TLD; $TLD = Net::Domain::TLD->new; } my $host = $self->_host( $args{address} or return $self->details ('tld') ); $host =~ m#\.(\w+)$#; $TLD->exists( $1 ); ================ Code that uses Net::Domain:TLD 1.65 25 Jan 2006 would be: ================ Line 20: omit Lines 167 - 174: use Net::Domain::TLD qw(tld_exists); my $host = $self->_host( $args{address} or return $self->details ('tld') ); $host =~ m#\.(\w+)$#; tld_exists( $1 ) or return $self->details('tld'); ================ Perhaps the line use Net::Domain::TLD qw(tld_exists); would be better at the top, with the other "use" statements. Sorry, I don't know how to create a patch.
Subject: Re: [rt.cpan.org #18226] tldcheck not compatible with current Net::Domain::TLD (1.65 25 Jan 2006)
Date: Fri, 17 Mar 2006 19:44:24 -0700
To: bug-Email-Valid [...] rt.cpan.org
From: Maurice Aubrey <maurice [...] redweek.com>
Thanks. I'll take a look. Guest via RT wrote: Show quoted text
> Fri Mar 17 19:40:49 2006: Request 18226 was acted upon. > Transaction: Ticket created by guest > Queue: Email-Valid > Subject: tldcheck not compatible with current Net::Domain::TLD (1.65 25 > Jan 2006) > Owner: Nobody > Requestors: fred@acheiversintlinc.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=18226 > > > > Email::Valid->address( -address => $testmail, -tldcheck => 1 ); > gives error: > Can't locate object method "new" via package "Net::Domain::TLD" > > This module's code for Net::Domain::TLD must be for an older version. > > Current code in Valid.pm > ================== > Line 20: > $TLD = Net::Domain::TLD->new if defined $Net::Domain::TLD::VERSION; > > Lines 167 - 174: > if (!defined $TLD) { > require Net::Domain::TLD; > $TLD = Net::Domain::TLD->new; > } > > my $host = $self->_host( $args{address} or return $self->details > ('tld') ); > $host =~ m#\.(\w+)$#; > $TLD->exists( $1 ); > ================ > > Code that uses Net::Domain:TLD 1.65 25 Jan 2006 would be: > ================ > Line 20: omit > > Lines 167 - 174: > use Net::Domain::TLD qw(tld_exists); > my $host = $self->_host( $args{address} or return $self->details > ('tld') ); > $host =~ m#\.(\w+)$#; > tld_exists( $1 ) or return $self->details('tld'); > ================ > > Perhaps the line > use Net::Domain::TLD qw(tld_exists); > would be better at the top, with the other "use" statements. > Sorry, I don't know how to create a patch. > > >
From: fred [...] achieversintlinc.com
[Note: there was a typo in my email address my original message] I learned how to create a patch file. This patch should be used ONLY if you have version 1.65 (25 Jan 2006) of Net::Domain::TLD installed. Valid.pm probably works as-is with older versions of Net::Domain::TLD - I don't know for sure. Email-Valid-0.15-Valid.pm-tldcheck.patch also corrects line 172 of the original Valid.pm, where the final close paren should be after "$self->_host( $args{address}" rather than at the end of the line. It also incorporates the patch from bug # 11919 which 'fixes the return values "mxcheck" or "tldcheck"' To apply this patch do the following: patch -d /usr/lib/perl[PATH_TO_EMAIL_VALID-0.15]/ < Email-Valid-0.15- Valid.pm-tldcheck.patch Of course, you use this patch at your own risk. Fred McIntyre On Fri Mar 17 21:44:47 2006, maurice@redweek.com wrote: Show quoted text
> Thanks. I'll take a look. > > Guest via RT wrote:
> > Fri Mar 17 19:40:49 2006: Request 18226 was acted upon. > > Transaction: Ticket created by guest > > Queue: Email-Valid > > Subject: tldcheck not compatible with current Net::Domain::TLD
> (1.65 25
> > Jan 2006) > > Owner: Nobody > > Requestors: fred@acheiversintlinc.com > > Status: new > > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=18226 > > > > > > > Email::Valid->address( -address => $testmail, -tldcheck => 1 ); > > gives error: > > Can't locate object method "new" via package "Net::Domain::TLD" > > > > This module's code for Net::Domain::TLD must be for an older
> version.
> > > > Current code in Valid.pm > > ================== > > Line 20: > > $TLD = Net::Domain::TLD->new if defined $Net::Domain::TLD::VERSION; > > > > Lines 167 - 174: > > if (!defined $TLD) { > > require Net::Domain::TLD; > > $TLD = Net::Domain::TLD->new; > > } > > > > my $host = $self->_host( $args{address} or return $self->details > > ('tld') ); > > $host =~ m#\.(\w+)$#; > > $TLD->exists( $1 ); > > ================ > > > > Code that uses Net::Domain:TLD 1.65 25 Jan 2006 would be: > > ================ > > Line 20: omit > > > > Lines 167 - 174: > > use Net::Domain::TLD qw(tld_exists); > > my $host = $self->_host( $args{address} or return $self->details > > ('tld') ); > > $host =~ m#\.(\w+)$#; > > tld_exists( $1 ) or return $self->details('tld'); > > ================ > > > > Perhaps the line > > use Net::Domain::TLD qw(tld_exists); > > would be better at the top, with the other "use" statements. > > Sorry, I don't know how to create a patch.
--- Valid.pm 2003-08-23 01:28:03.000000000 -0700 +++ Valid-tldfixed.pm 2006-03-21 10:54:07.171489236 -0800 @@ -8,6 +8,7 @@ use IO::File; use Mail::Address; use File::Spec; +use Net::Domain::TLD qw(tld_exists); $VERSION = '0.15'; @@ -17,7 +18,6 @@ # initialize if already loaded, better in prefork mod_perl environment $DNS_Method = defined $Net::DNS::VERSION ? 'Net::DNS' : ''; -$TLD = Net::Domain::TLD->new if defined $Net::Domain::TLD::VERSION; sub new { my $class = shift; @@ -163,15 +163,9 @@ sub tld { my $self = shift; my %args = $self->_rearrange([qw( address )], \@_); - - if (!defined $TLD) { - require Net::Domain::TLD; - $TLD = Net::Domain::TLD->new; - } - - my $host = $self->_host( $args{address} or return $self->details('tld') ); + my $host = $self->_host( $args{address}) or return $self->details('tld'); $host =~ m#\.(\w+)$#; - $TLD->exists( $1 ); + tld_exists( $1 ) or return $self->details('tld'); } # Purpose: Check whether a DNS record (A or MX) exists for a domain. @@ -272,11 +266,11 @@ } if ($args{mxcheck}) { - $self->mx( $addr->host ) or return; + $self->mx( $addr->host ) or return $self->details('mx'); } if ($args{tldcheck}) { - $self->tld( $addr->host ) or return; + $self->tld( $addr->host ) or return $self->details('tld'); } return (wantarray ? ($addr->address, $addr) : $addr->address);
Subject: Other bug reports/references
Hi, The following bug reports -one in Debian, one here in CPAN- have a patch equivalent to this one, might shed some more light: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=360792 http://rt.cpan.org/Public/Bug/Display.html?id=17915 The patch is quite straightforward. I'll be applying the patch found in the Debian bug report to our packaging. Of course, if you decide to apply this or another and fix the problem in your packaging, we will go back to the main line. Greetings,