Skip Menu |

This queue is for tickets about the Net-CIDR-Lookup CPAN distribution.

Report information
The Basics
Id: 97098
Status: resolved
Priority: 0/
Queue: Net-CIDR-Lookup

People
Owner: Nobody in particular
Requestors: ckb [...] xerocole.com
Cc:
AdminCc:

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



Subject: Use of "//" operator
Date: Wed, 9 Jul 2014 13:11:44 -0700
To: "bug-Net-CIDR-Lookup [...] rt.cpan.org" <bug-Net-CIDR-Lookup [...] rt.cpan.org>
From: "Christopher K. Brown" <ckb [...] xerocole.com>
Greetings!  I found that this module uses the "//" operator as an "or" which gives it a dependency on the version of perl 5 that can run it.  For example, perl 5.10 does not know what "//" is, but 5.18 does.  I do not believe CPAN is enforcing this dependency. Maybe the easiest thing to do is to replace the "//" with "||" in the script?  The proper "requires" would also do it. It's possible CPAN is broken by allowing me to install this module on my 5.10 distribution...if so I apologize for the intrusion. :-) Thanks! 
On 2014-07-09 13:11:53, ckb@xerocole.com wrote: Show quoted text
> > > Greetings!  I found that this module uses the "//" operator as an "or" > which gives it a dependency on the version of perl 5 that can run it.  > For example, perl 5.10 does not know what "//" is, but 5.18 does.  I > do not believe CPAN is enforcing this dependency. > > Maybe the easiest thing to do is to replace the "//" with "||" in the > script?  The proper "requires" would also do it. > > It's possible CPAN is broken by allowing me to install this module on > my 5.10 distribution...if so I apologize for the intrusion. :-) > > Thanks!
The // operator was added in perl 5.10.0: http://perldoc.perl.org/perl5100delta.html#Defined-or-operator However, this distribution is not properly declaring the minimum perl version (MIN_PERL_VERSION in Makefile.PL WriteMakefile()). This line should be added to Makefile.PL: MIN_PERL_VERSION => '5.010', See also: http://cpants.cpanauthors.org/dist/Net-CIDR-Lookup
Subject: Re: Use of "//" operator
Date: Wed, 9 Jul 2014 13:32:42 -0700
To: "bug-Net-CIDR-Lookup [...] rt.cpan.org" <bug-Net-CIDR-Lookup [...] rt.cpan.org>
From: "Christopher K. Brown" <ckb [...] xerocole.com>
Two clarifications:  - Perl 5.8.8 does not support "//" and that's what CPAN allowed me to install the module on, not perl 5.10 (which does support //). - A straight sub to "||" might not work.  Would be something along the lines of: $node = pop @node_stack; last unless $node; Hopefully it's just a dependency thing.  I would really have wanted CPAN to serve me the 0.30 version instead of the latest if my tired old perl did not meet the requirements.  I believe 0.30 is the oldest version that does not use the "//". From: Christopher K. Brown <ckb@xerocole.com> Show quoted text
>To: "bug-Net-CIDR-Lookup@rt.cpan.org" <bug-Net-CIDR-Lookup@rt.cpan.org> >Sent: Wednesday, July 9, 2014 4:11 PM >Subject: Use of "//" operator > > > > > >Greetings!  I found that this module uses the "//" operator as an "or" which gives it a dependency on the version of perl 5 that can run it.  For example, perl 5.10 does not know what "//" is, but 5.18 does.  I do not believe CPAN is enforcing this dependency. > > >Maybe the easiest thing to do is to replace the "//" with "||" in the script?  The proper "requires" would also do it. > > >It's possible CPAN is broken by allowing me to install this module on my 5.10 distribution...if so I apologize for the intrusion. :-) > > >Thanks!  > >
On 2014-07-09 13:32:53, ckb@xerocole.com wrote: Show quoted text
> > > Two clarifications: > > - Perl 5.8.8 does not support "//" and that's what CPAN allowed me to > install the module on, not perl 5.10 (which does support //).
Thanks for the clarification. You said "For example, perl 5.10 does not know what "//" is". As I said in the reply, the distribution isn't properly declaring the minimum perl version, so that needs to be fixed -- or fixing the code to remove the need for // in the first place. (I'm not a maintainer of this distribution, but just a casual observer.) Show quoted text
> Hopefully it's just a dependency thing.  I would really have wanted > CPAN to serve me the 0.30 version instead of the latest if my tired > old perl did not meet the requirements.  I believe 0.30 is the oldest > version that does not use the "//".
The normal CPAN mirrors serve up the latest version of everything. You can, however, point your client to one of the cpXXXan mirrors to get the most recent version that happens to work on your particular configuration: http://cpxxxan.barnyard.co.uk/
In 0.53 I just removed the single use of this operator so it should work on 5.8 again.