Skip Menu |

This queue is for tickets about the Socket6 CPAN distribution.

Report information
The Basics
Id: 32362
Status: resolved
Priority: 0/
Queue: Socket6

People
Owner: Nobody in particular
Requestors: SHLOMIF [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.19
Fixed in: 0.20



Subject: Socket6 exports some symbols that are also exported by Socket in perl-5.10.x causing warnings
The IO::Socket::INET6 contains the following code: <<<<<<<<<<< use Socket; use Socket6; Show quoted text
>>>>>>>>>>>
This generates a few warnings every time the module is loaded. Running this from the command line, causes this: <<<<<<<<<<<< shlomi:~$ perl -MSocket -MSocket6 -e 'printf("%i\n", AF_INET6)' Constant subroutine main::AF_INET6 redefined at /usr/lib/perl5/5.10.0/Exporter.pm line 66. at -e line 0 Prototype mismatch: sub main::AF_INET6 () vs none at /usr/lib/perl5/5.10.0/Exporter.pm line 66. at -e line 0 Constant subroutine main::PF_INET6 redefined at /usr/lib/perl5/5.10.0/Exporter.pm line 66. at -e line 0 Prototype mismatch: sub main::PF_INET6 () vs none at /usr/lib/perl5/5.10.0/Exporter.pm line 66. at -e line 0 10 Show quoted text
>>>>>>>>>>>>
It's broken on 5.10.0, but I recall it worked perfectly on 5.8.8. Please make the AF_INET6 and PF_INET6 exports optional.
Subject: Re: [rt.cpan.org #32362] Socket6 exports some symbols that are also exported by Socket in perl-5.10.x causing warnings
Date: Sun, 27 Jan 2008 22:30:57 +0900
To: bug-Socket6 [...] rt.cpan.org
From: Hajimu UMEMOTO <ume [...] mahoroba.org>
Hi, Show quoted text
>>>>> On Wed, 16 Jan 2008 14:23:38 -0500 >>>>> "Shlomi Fish via RT" <bug-Socket6@rt.cpan.org> said:
bug-Socket6> It's broken on 5.10.0, but I recall it worked perfectly on 5.8.8. bug-Socket6> Please make the AF_INET6 and PF_INET6 exports optional. I'm okay to change to do so. But, how can I do? As far as I read Exporter.pm, it seems using EXPORT_FAIL does it. However, I'm not sure. Does adding following lines into Socket6.pm solve this issue? @EXPORT_FAIL = qw( AF_INET6 PF_INET6 ); sub export_fail { } Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/
From: SHLOMIF [...] cpan.org
On Sun Jan 27 08:31:47 2008, UMEMOTO wrote: Show quoted text
> Hi, >
> >>>>> On Wed, 16 Jan 2008 14:23:38 -0500 > >>>>> "Shlomi Fish via RT" <bug-Socket6@rt.cpan.org> said:
> > bug-Socket6> It's broken on 5.10.0, but I recall it worked perfectly > on 5.8.8. > bug-Socket6> Please make the AF_INET6 and PF_INET6 exports optional. > > I'm okay to change to do so. But, how can I do? > As far as I read Exporter.pm, it seems using EXPORT_FAIL does it. > However, I'm not sure. Does adding following lines into Socket6.pm > solve this issue? > > @EXPORT_FAIL = qw( > AF_INET6 > PF_INET6 > ); > > sub export_fail { > } >
Without these lines I'm getting: <<<<<<<<<<<<<<<<<<<<< shlomi:~$ perl -MSocket -MSocket6 -e 'printf("%i\n", AF_INET6)' Constant subroutine main::AF_INET6 redefined at /usr/lib/perl5/5.10.0/Exporter.pm line 66. at -e line 0 Prototype mismatch: sub main::AF_INET6 () vs none at /usr/lib/perl5/5.10.0/Exporter.pm line 66. at -e line 0 Constant subroutine main::PF_INET6 redefined at /usr/lib/perl5/5.10.0/Exporter.pm line 66. at -e line 0 Prototype mismatch: sub main::PF_INET6 () vs none at /usr/lib/perl5/5.10.0/Exporter.pm line 66. at -e line 0 10 Show quoted text
>>>>>>>>>>>>>>>>>>>>>
And with these lines: <<<<<<<<<<<<<<<<<<<<<<< shlomi:~$ perl -I. -MSocket -MSocket6 -e 'printf("%i\n", AF_INET6)' Constant subroutine main::AF_INET6 redefined at -e line 0 main::BEGIN() called at Socket6.pm line 0 eval {...} called at Socket6.pm line 0 Prototype mismatch: sub main::AF_INET6 () vs none at -e line 0 main::BEGIN() called at Socket6.pm line 0 eval {...} called at Socket6.pm line 0 Constant subroutine main::PF_INET6 redefined at -e line 0 main::BEGIN() called at Socket6.pm line 0 eval {...} called at Socket6.pm line 0 Prototype mismatch: sub main::PF_INET6 () vs none at -e line 0 main::BEGIN() called at Socket6.pm line 0 eval {...} called at Socket6.pm line 0 10 Show quoted text
>>>>>>>>>>>>>>>>>>>>>>>
Regards, Shlomi Fish Show quoted text
> Sincerely, > > -- > Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan > ume@mahoroba.org ume@{,jp.}FreeBSD.org > http://www.imasy.org/~ume/
CC: Hajimu UMEMOTO <ume [...] mahoroba.org>
Subject: Re: [rt.cpan.org #32362] Socket6 exports some symbols that are also exported by Socket in perl-5.10.x causing warnings
Date: Fri, 08 Feb 2008 00:46:49 +0900
To: bug-Socket6 [...] rt.cpan.org
From: Hajimu UMEMOTO <ume [...] mahoroba.org>
Hi, Show quoted text
>>>>> On Sun, 27 Jan 2008 16:41:09 -0500 >>>>> "Shlomi Fish via RT" <bug-Socket6@rt.cpan.org> said:
bug-Socket6> And with these lines: bug-Socket6> <<<<<<<<<<<<<<<<<<<<<<< bug-Socket6> shlomi:~$ perl -I. -MSocket -MSocket6 -e 'printf("%i\n", AF_INET6)' bug-Socket6> Constant subroutine main::AF_INET6 redefined at -e line 0 bug-Socket6> main::BEGIN() called at Socket6.pm line 0 bug-Socket6> eval {...} called at Socket6.pm line 0 bug-Socket6> Prototype mismatch: sub main::AF_INET6 () vs none at -e line 0 bug-Socket6> main::BEGIN() called at Socket6.pm line 0 bug-Socket6> eval {...} called at Socket6.pm line 0 bug-Socket6> Constant subroutine main::PF_INET6 redefined at -e line 0 bug-Socket6> main::BEGIN() called at Socket6.pm line 0 bug-Socket6> eval {...} called at Socket6.pm line 0 bug-Socket6> Prototype mismatch: sub main::PF_INET6 () vs none at -e line 0 bug-Socket6> main::BEGIN() called at Socket6.pm line 0 bug-Socket6> eval {...} called at Socket6.pm line 0 bug-Socket6> 10 bug-Socket6> >>>>>>>>>>>>>>>>>>>>>>> Umm, then, could you try following patch? Index: Socket6.pm =================================================================== RCS file: /usr/home/ume/pcvs/src/Socket6/Socket6.pm,v retrieving revision 1.37 diff -u -p -r1.37 Socket6.pm --- Socket6.pm 27 Jan 2008 08:59:11 -0000 1.37 +++ Socket6.pm 5 Feb 2008 12:29:26 -0000 @@ -220,7 +220,6 @@ require DynaLoader; gethostbyname2 getaddrinfo getnameinfo in6addr_any in6addr_loopback gai_strerror getipnodebyname getipnodebyaddr - AF_INET6 AI_ADDRCONFIG AI_ALL AI_CANONNAME @@ -267,8 +266,9 @@ require DynaLoader; NI_NUMERICSERV NI_DGRAM NI_WITHSCOPEID - PF_INET6 ); +push @EXPORT, qw(AF_INET6) unless defined Socket::AF_INET6; +push @EXPORT, qw(PF_INET6) unless defined Socket::PF_INET6; %EXPORT_TAGS = ( all => [@EXPORT], Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/
From: SHLOMIF [...] cpan.org
On Thu Feb 07 12:36:28 2008, UMEMOTO wrote: Show quoted text
> Hi, >
> >>>>> On Sun, 27 Jan 2008 16:41:09 -0500 > >>>>> "Shlomi Fish via RT" <bug-Socket6@rt.cpan.org> said:
> > bug-Socket6> And with these lines: > > bug-Socket6> <<<<<<<<<<<<<<<<<<<<<<< > bug-Socket6> shlomi:~$
perl -I. -MSocket -MSocket6 -e 'printf("%i\n", Show quoted text
> AF_INET6)' > bug-Socket6> Constant subroutine main::AF_INET6 redefined at -e line
0 Show quoted text
> bug-Socket6> main::BEGIN() called at Socket6.pm line 0 > bug-Socket6> eval {...} called at Socket6.pm line 0 > bug-Socket6> Prototype mismatch: sub main::AF_INET6 () vs none at -e > line 0 > bug-Socket6> main::BEGIN() called at Socket6.pm line 0 > bug-Socket6> eval {...} called at Socket6.pm line 0 > bug-Socket6> Constant subroutine main::PF_INET6 redefined at -e line
0 Show quoted text
> bug-Socket6> main::BEGIN() called at Socket6.pm line 0 > bug-Socket6> eval {...} called at Socket6.pm line 0 > bug-Socket6> Prototype mismatch: sub main::PF_INET6 () vs none at -e > line 0 > bug-Socket6> main::BEGIN() called at Socket6.pm line 0 > bug-Socket6> eval {...} called at Socket6.pm line 0 > bug-Socket6> 10 > bug-Socket6> >>>>>>>>>>>>>>>>>>>>>>> > > Umm, then, could you try following patch? >
This patch wouldn't apply cleanly from some reason, but a modified patch (attached) seems to have resolved the bug: <<<<<<<<< shlomi:~$ perl -I. -MSocket -MSocket6 -e 'printf("%i\n", AF_INET6)' 10 shlomi:~$ Show quoted text
>>>>>>>>>
Thanks! Regards, Shlomi Fish Show quoted text
> Index: Socket6.pm > =================================================================== > RCS file: /usr/home/ume/pcvs/src/Socket6/Socket6.pm,v > retrieving revision 1.37 > diff -u -p -r1.37 Socket6.pm > --- Socket6.pm 27 Jan 2008 08:59:11 -0000 1.37 > +++ Socket6.pm 5 Feb 2008 12:29:26 -0000 > @@ -220,7 +220,6 @@ require DynaLoader; > gethostbyname2 getaddrinfo getnameinfo > in6addr_any in6addr_loopback > gai_strerror getipnodebyname getipnodebyaddr > - AF_INET6 > AI_ADDRCONFIG > AI_ALL > AI_CANONNAME > @@ -267,8 +266,9 @@ require DynaLoader; > NI_NUMERICSERV > NI_DGRAM > NI_WITHSCOPEID > - PF_INET6 > ); > +push @EXPORT, qw(AF_INET6) unless defined Socket::AF_INET6; > +push @EXPORT, qw(PF_INET6) unless defined Socket::PF_INET6; > > %EXPORT_TAGS = ( > all => [@EXPORT], > > Sincerely, > > -- > Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan > ume@mahoroba.org ume@{,jp.}FreeBSD.org > http://www.imasy.org/~ume/
--- Socket6.pm.orig 2008-02-07 20:38:46.387193127 +0200 +++ Socket6.pm 2008-02-07 20:40:30.166982764 +0200 @@ -213,7 +213,6 @@ gethostbyname2 getaddrinfo getnameinfo in6addr_any in6addr_loopback gai_strerror getipnodebyname getipnodebyaddr - AF_INET6 AI_ADDRCONFIG AI_ALL AI_CANONNAME @@ -247,8 +246,10 @@ NI_NUMERICSERV NI_DGRAM NI_WITHSCOPEID - PF_INET6 ); +push @EXPORT, qw(AF_INET6) unless defined Socket::AF_INET6; +push @EXPORT, qw(PF_INET6) unless defined Socket::PF_INET6; + %EXPORT_TAGS = ( all => [@EXPORT],
CC: Hajimu UMEMOTO <ume [...] mahoroba.org>
Subject: Re: [rt.cpan.org #32362] Socket6 exports some symbols that are also exported by Socket in perl-5.10.x causing warnings
Date: Sat, 16 Feb 2008 15:29:39 +0900
To: bug-Socket6 [...] rt.cpan.org
From: Hajimu UMEMOTO <ume [...] mahoroba.org>
Hi, Show quoted text
>>>>> On Thu, 07 Feb 2008 13:46:49 -0500 >>>>> "Shlomi Fish via RT" <bug-Socket6@rt.cpan.org> said:
bug-Socket6> This patch wouldn't apply cleanly from some reason, but a modified bug-Socket6> patch (attached) seems to have resolved the bug: bug-Socket6> <<<<<<<<< bug-Socket6> shlomi:~$ perl -I. -MSocket -MSocket6 -e 'printf("%i\n", AF_INET6)' bug-Socket6> 10 bug-Socket6> shlomi:~$ bug-Socket6> >>>>>>>>> Oops, the patch was against the source which was modified locally. Thank you for confirmation. I've just uploaded Socket6-0.20 to CPAN. Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/