Skip Menu |

This queue is for tickets about the FindBin-libs CPAN distribution.

Report information
The Basics
Id: 71166
Status: resolved
Worked: 2 hours (120 min)
Priority: 0/
Queue: FindBin-libs

People
Owner: LEMBARK [...] cpan.org
Requestors: YIBE [...] cpan.org
Cc:
AdminCc:

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



Subject: Perl 5.10 support?
Because of the "use v5.12;" statement, FindBin::libs 1.52 ($VERSION remains "1.5100". Should be bumped.) doesn't work with Perl 5.10, which I believe is still used in many environments. Is this the intended behavior? (The CHANGES file seems to say no...)
From: felix.ostmann [...] thewar.de
You forgot one file ... $ perl Makefile.PL Perl v5.12.0 required--this is only v5.10.1, stopped at Makefile.PL line 1. BEGIN failed--compilation aborted at Makefile.PL line 1. $ head Makefile.PL use 5.012; use ExtUtils::MakeMaker; ... Am Do 22. Sep 2011, 14:07:38, YIBE schrieb: Show quoted text
> Because of the "use v5.12;" statement, FindBin::libs 1.52 > ($VERSION remains "1.5100". Should be bumped.) doesn't work with > Perl 5.10, which I believe is still used in many environments. > Is this the intended behavior? (The CHANGES file seems to say no...)
On Wed Nov 23 07:56:15 2011, Sadrak wrote: Show quoted text
> You forgot one file ... > > $ perl Makefile.PL > Perl v5.12.0 required--this is only v5.10.1, stopped at Makefile.PL
line 1. Show quoted text
>
oops... fixed in 1.55. The 5.10 won't compile it, however. Aside from removing strict, I'll be actually using pieces of 5.12 fairly soon. Q: Is there any chance you will be upgrading?
On Thu Sep 22 14:07:38 2011, YIBE wrote: Show quoted text
> Because of the "use v5.12;" statement, FindBin::libs 1.52 > ($VERSION remains "1.5100". Should be bumped.) doesn't work with > Perl 5.10, which I believe is still used in many environments. > Is this the intended behavior? (The CHANGES file seems to say no...)
After trying a few other alternatives, I've decided to just maintain separate modules for the current and older versions. There are now two back-end modules: libs_5_8.pm and libs_5_12.pm with an if-block in libs.pm to use the appropriate one based on $^V. The procedure works here with v5.14. Please check if this works on your system.
Subject: FindBin-libs-1.56.tar.gz
Download FindBin-libs-1.56.tar.gz
application/x-gzip 11.2k

Message body not shown because it is not plain text.

On Thu Sep 22 14:07:38 2011, YIBE wrote: Show quoted text
> Because of the "use v5.12;" statement, FindBin::libs 1.52 > ($VERSION remains "1.5100". Should be bumped.) doesn't work with > Perl 5.10, which I believe is still used in many environments. > Is this the intended behavior? (The CHANGES file seems to say no...)
I've added an updated distribution, 1.57, which has copies of the module for < v5.12 and another for the current perl distro.
Subject: FindBin-libs-1.57.tar.gz
Download FindBin-libs-1.57.tar.gz
application/x-gzip 14k

Message body not shown because it is not plain text.

1.57 is on PAUSE, should be on CPAN shortly.
Sorry I had overlooked some emails about this ticket... I gave 1.59 a try with Perl 5.8.9 and 5.10.1, but failed to install it because: 1. "$^V < v5.12" seems to always return true because $^V and v5.12 are actually not numeric values (See "perlvar" etc.). So you should use either "$] < 5.012000" or "!$^V || $^V lt v5.12" instead. 2. A semicolon is missing at libs_5_8.pm line 84: Show quoted text
> our $VERSION = v1.58
With these fixed, it passes all the tests and is successfully installed. Thanks,
On Sun, 18 Dec 2011 04:29:54 +0900, YIBE wrote: Show quoted text
> 1. "$^V < v5.12" seems to always return true ...
Oops, I meant to say that it returns *false*. And apparently this happens only with perl < 5.10. ---- $ perl5.8.9 -e 'print $^V < v5.12 ? 1 : 0' 0 $ perl5.10.1 -e 'print $^V < v5.12 ? 1 : 0' 1 ----
On Sat Dec 17 16:21:49 2011, YIBE wrote: Show quoted text
> On Sun, 18 Dec 2011 04:29:54 +0900, YIBE wrote:
> > 1. "$^V < v5.12" seems to always return true ...
> > Oops, I meant to say that it returns *false*. And apparently this happens > only with perl < 5.10. > > ---- > $ perl5.8.9 -e 'print $^V < v5.12 ? 1 : 0' > 0 > $ perl5.10.1 -e 'print $^V < v5.12 ? 1 : 0' > 1 > ----
$^V is a vstring in perl 5.8 (i.e., v5.8.9 or "\5\x8\x9"). In 5.10 it’s a version object, which has Show quoted text
> and < overloading.
On Sat Dec 17 19:30:34 2011, SPROUT wrote: Show quoted text
> On Sat Dec 17 16:21:49 2011, YIBE wrote:
> > On Sun, 18 Dec 2011 04:29:54 +0900, YIBE wrote:
> > > 1. "$^V < v5.12" seems to always return true ...
> > > > Oops, I meant to say that it returns *false*. And apparently this
> happens
> > only with perl < 5.10.
Sorry for the delay. Between my mother dying and being out of the country I couldn't keep up very well... Got my hands on a 5.8 system. Looks like the only way to deal with is is unpack $^V or trust %Config. So... that leaves me with: package FindBin::libs; use strict; use version; use Config; our $VERSION=1.50; # use the older code suitable for v5.8 if we are # running on anything before v5.12. my $cutoff = version->new( 'v5.12' ); my $running = version->new( scalar $Config{ version } ); BEGIN { $running < $cutoff ? require FindBin::libs_5_8 : require FindBin::libs_curr ; }
What does "$^V" look like on v5.10 (i.e. is it a packed integer or a v- string)?
On Tue Feb 14 10:41:28 2012, LEMBARK wrote: Show quoted text
> What does "$^V" look like on v5.10 (i.e. is it a packed integer or a v- > string)?
"$^V" eq "v5.10.0". It’s a version object, and that’s how they stringify. Since version objects have cmp overloading, you can use $^V ge v5.10, which will work whether $^V is a version object or vstring.
RT-Send-CC: felix.ostmann [...] thewar.de
On Sat Dec 17 19:30:34 2011, SPROUT wrote: Show quoted text
> On Sat Dec 17 16:21:49 2011, YIBE wrote:
> > On Sun, 18 Dec 2011 04:29:54 +0900, YIBE wrote:
> > > 1. "$^V < v5.12" seems to always return true ...
> > > > Oops, I meant to say that it returns *false*. And apparently this
> happens
> > only with perl < 5.10.
Checking the perldelta doc's the likely cutoff is 5.10, with the test being for $^V being an object (via ref $^V ? old : new). I have replaced Makefile.PL with Build.PL since it has a built-in handler for substituting files. So, at this point if $^V is a ref you get the libs_curr.pm installed as libs.pm; otherwise you get the libs_5_8.pm. Saves the startup logic entirely. If this works for you then I can close this. thanks for your patience.
Subject: FindBin-libs-1.62.tar.gz
Download FindBin-libs-1.62.tar.gz
application/x-gzip 19.1k

Message body not shown because it is not plain text.

I've changed this from Makefile.PL to Module::Builder. The installer should pick the correct version to install at this point (M::B has built- in support for choosing which file to use).
Subject: FindBin-libs-1.62.tar.gz
Download FindBin-libs-1.62.tar.gz
application/x-gzip 19.1k

Message body not shown because it is not plain text.

Show quoted text
> Checking the perldelta doc's the likely cutoff is 5.10, with the test > being for $^V being an object (via ref $^V ? old : new).
The "ref $^V ? 'curr' : '5_8'" solution works for me with 5.8 and 5.10, but why not go with either of these two, which are more straightforward? $] < 5.010 ? '5_8' : 'curr' !$^V || $^V lt v5.10 ? '5_8' : 'curr' Show quoted text
> I have replaced Makefile.PL with Build.PL since it has a built-in > handler for substituting files. So, at this point if $^V is a ref you > get the libs_curr.pm installed as libs.pm; otherwise you get the > libs_5_8.pm. Saves the startup logic entirely.
So now that the FindBin/libs_{5_8,curr}.pm files are not expanded into the blib directory, the use_ok tests for them in t/01-use-ok.t must also be removed for the dist to be successfully installed without the force option.
On Wed Feb 15 07:21:46 2012, YIBE wrote: Show quoted text
> > Checking the perldelta doc's the likely cutoff is 5.10, with the test > > being for $^V being an object (via ref $^V ? old : new).
> > The "ref $^V ? 'curr' : '5_8'" solution works for me with 5.8 and 5.10, > but why not go with either of these two, which are more straightforward? > > $] < 5.010 ? '5_8' : 'curr' > > !$^V || $^V lt v5.10 ? '5_8' : 'curr' >
> > I have replaced Makefile.PL with Build.PL since it has a built-in > > handler for substituting files. So, at this point if $^V is a ref you > > get the libs_curr.pm installed as libs.pm; otherwise you get the > > libs_5_8.pm. Saves the startup logic entirely.
> > So now that the FindBin/libs_{5_8,curr}.pm files are not expanded into > the blib > directory, the use_ok tests for them in t/01-use-ok.t must also be > removed > for the dist to be successfully installed without the force option.
Also beware that multiple perl versions can share include directories. It’s only the architecture-specific directories that are always unshared.
CC: lembark [...] wrkhors.com
Subject: Re: [rt.cpan.org #71166] Perl 5.10 support?
Date: Thu, 16 Feb 2012 08:06:37 -0600
To: bug-FindBin-libs [...] rt.cpan.org
From: Steven Lembark <lembark [...] wrkhors.com>
On Wed, 15 Feb 2012 07:21:46 -0500 "Yuki Ibe via RT" <bug-FindBin-libs@rt.cpan.org> wrote: Show quoted text
> Queue: FindBin-libs > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=71166 > >
> > Checking the perldelta doc's the likely cutoff is 5.10, with the test > > being for $^V being an object (via ref $^V ? old : new).
> > The "ref $^V ? 'curr' : '5_8'" solution works for me with 5.8 and 5.10, > but why not go with either of these two, which are more straightforward? > > $] < 5.010 ? '5_8' : 'curr' > > !$^V || $^V lt v5.10 ? '5_8' : 'curr'
From perldoc perlvar: "Deprecated in Perl 5.6." Show quoted text
> > I have replaced Makefile.PL with Build.PL since it has a built-in > > handler for substituting files. So, at this point if $^V is a ref you > > get the libs_curr.pm installed as libs.pm; otherwise you get the > > libs_5_8.pm. Saves the startup logic entirely.
> > So now that the FindBin/libs_{5_8,curr}.pm files are not expanded into > the blib > directory, the use_ok tests for them in t/01-use-ok.t must also be > removed > for the dist to be successfully installed without the force option.
Good point. Odd thing is that it passed "Build test" here... may be related to building the blib from everything present and only copying the libs.pm or something. I've updated the test. -- Steven Lembark 3646 Flora Pl Workhorse Computing St Louis, MO 63110 lembark@wrkhors.com +1 888 359 3508
CC: lembark [...] wrkhors.com
Subject: Re: [rt.cpan.org #71166] Perl 5.10 support?
Date: Thu, 16 Feb 2012 08:13:26 -0600
To: bug-FindBin-libs [...] rt.cpan.org
From: Steven Lembark <lembark [...] wrkhors.com>
On Wed, 15 Feb 2012 07:21:46 -0500 "Yuki Ibe via RT" <bug-FindBin-libs@rt.cpan.org> wrote: Show quoted text
> So now that the FindBin/libs_{5_8,curr}.pm files are not expanded into > the blib > directory, the use_ok tests for them in t/01-use-ok.t must also be > removed > for the dist to be successfully installed without the force option.
Still cannot figure out why it passes the disttest here with the original t/01... In any case, 1.63 has the fixed test. -- Steven Lembark 3646 Flora Pl Workhorse Computing St Louis, MO 63110 lembark@wrkhors.com +1 888 359 3508
On Thu, 16 Feb 2012 23:09:13 +0900, lembark@wrkhors.com wrote: Show quoted text
> On Wed, 15 Feb 2012 07:21:46 -0500 > "Yuki Ibe via RT" <bug-FindBin-libs@rt.cpan.org> wrote: >
> > So now that the FindBin/libs_{5_8,curr}.pm files are not expanded
into Show quoted text
> > the blib > > directory, the use_ok tests for them in t/01-use-ok.t must also be > > removed > > for the dist to be successfully installed without the force option.
> > Still cannot figure out why it passes the disttest here > with the original t/01... In any case, 1.63 has the fixed > test. >
I guess your perl is use-ing already installed ones, which are left in your @INC directories. Anyway, now it works with both 5.8 and 5.10+. Thank you!
On Thu, 16 Feb 2012 23:02:23 +0900, lembark@wrkhors.com wrote: Show quoted text
> On Wed, 15 Feb 2012 07:21:46 -0500 > "Yuki Ibe via RT" <bug-FindBin-libs@rt.cpan.org> wrote: >
> > Queue: FindBin-libs > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=71166 > > >
> > > Checking the perldelta doc's the likely cutoff is 5.10, with the
test Show quoted text
> > > being for $^V being an object (via ref $^V ? old : new).
> > > > The "ref $^V ? 'curr' : '5_8'" solution works for me with 5.8 and
5.10, Show quoted text
> > but why not go with either of these two, which are more
straightforward? Show quoted text
> > > > $] < 5.010 ? '5_8' : 'curr' > > > > !$^V || $^V lt v5.10 ? '5_8' : 'curr'
> > From perldoc perlvar: "Deprecated in Perl 5.6." >
Ah okay, I wasn't aware that $] was officially deprecated. However, it has been valid to compare $^V and vN.N.N with the string comparison operators (cmp, eq, ne, lt, le, gt, ge) since 5.6.0 - as SPROUT also wrote: Show quoted text
> Since version objects have cmp overloading, you can use $^V ge
v5.10, Show quoted text
> which will work whether > $^V is a version object or vstring.
On Sat Feb 18 08:36:33 2012, YIBE wrote: Show quoted text
> On Thu, 16 Feb 2012 23:02:23 +0900, lembark@wrkhors.com wrote:
> > On Wed, 15 Feb 2012 07:21:46 -0500 > > "Yuki Ibe via RT" <bug-FindBin-libs@rt.cpan.org> wrote: > >
> > > Queue: FindBin-libs > > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=71166 > > > >
> > > > Checking the perldelta doc's the likely cutoff is 5.10, with the
> test
> > > > being for $^V being an object (via ref $^V ? old : new).
> > > > > > The "ref $^V ? 'curr' : '5_8'" solution works for me with 5.8 and
> 5.10,
> > > but why not go with either of these two, which are more
> straightforward?
> > > > > > $] < 5.010 ? '5_8' : 'curr' > > > > > > !$^V || $^V lt v5.10 ? '5_8' : 'curr'
> > > > From perldoc perlvar: "Deprecated in Perl 5.6."
And it was un-deprecated in 5.8. See http://www.nntp.perl.org/group/perl.perl5.porters/;msgid=20011022034838.B1676@blackr ider and perl commit 0c8d858bc. That sentence, which appears to have been added to perlvar in 5.14.0, needs to be deleted. (I’ve just deleted it in commit 32ac708.) Show quoted text
> >
> > Ah okay, I wasn't aware that $] was officially deprecated. However, it > has > been valid to compare $^V and vN.N.N with the string comparison > operators > (cmp, eq, ne, lt, le, gt, ge) since 5.6.0 - as SPROUT also wrote: >
> > Since version objects have cmp overloading, you can use $^V ge
> v5.10,
> > which will work whether > > $^V is a version object or vstring.
Show quoted text
> > Ah okay, I wasn't aware that $] was officially deprecated. However,
> it
> > has > > been valid to compare $^V and vN.N.N with the string comparison > > operators > > (cmp, eq, ne, lt, le, gt, ge) since 5.6.0 - as SPROUT also wrote: > >
> > > Since version objects have cmp overloading, you can use $^V ge
> > v5.10,
> > > which will work whether > > > $^V is a version object or vstring.
Since been informed that $[ is un-deprecated... luvly. The ref $^V hack was the first thing I found that seemed to work. Eventually the best way will be $^V lt v5.10, or a switch on the versions. Guessing there will eventually have to be a version-specific install flag in M::B to account for this kind of thing automatically (or maybe there is one and I didn't have time to find it this time around).
Hack using ref $^V works as a decent cutoff for now. Have to find something cleaner eventually after checking M::B doc's a bit further.