incorrect behaviour in use clause specifying Class::Std version in perl 5.8.8

J

Julien

Hi,

After discovering that I was accidentally using Class::Std version
0.0.2 instead of 0.0.8, I tried to specify the version in the use
clause to detect such problems in the future. However, perl 5.8.8
doesn't seem to handle this properly. Since I have already installed
Class::Std version 0.0.8, I will try to require version 0.0.9 to
illustrate the problem I had (even though 0.0.9 doesn't yet exist):

Under perl 5.8.6, the use clause works:

[user@host ~]$ perl --version

This is perl, v5.8.6 built for i386-linux-thread-multi

Copyright 1987-2004, Larry Wall

Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5 source
kit.

Complete documentation for Perl, including FAQ lists, should be found
on
this system using `man perl' or `perldoc perl'. If you have access to
the
Internet, point your browser at http://www.perl.org/, the Perl Home
Page.

[user@host ~]$ perl -e 'use Class::Std 0.000009;'
Class::Std version 0.000009 (v0.0.9) required--this is only version
0.000008 (v0.0.8) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

.... so compilation failed, which is what I wanted/expected. However
under perl 5.8.8 :

[user@host ~]$ perl --version

This is perl, v5.8.8 built for i386-linux-thread-multi

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5 source
kit.

Complete documentation for Perl, including FAQ lists, should be found
on
this system using "man perl" or "perldoc perl". If you have access to
the
Internet, point your browser at http://www.perl.org/, the Perl Home
Page.

[user@host ~]$ perl -e 'use Class::Std 0.000009;'
[user@host ~]$ perl -e 'use Class::Std 1.000009;'
Class::Std version 1.000009 (v1.0.9) required--this is only version
0.000008 (v0.0.8) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

So we see that the installed Class::Std is version 0.0.8, but requiring
version 0.0.9 doesn't work (i.e. compilation did not fail). Requiring
v1.0.9 does lead to a compilation failure however.

Am I doing something wrong? It seems that leading 0's aren't being
handled properly under perl 5.8.8? Should I report this as a bug?

Thanks,

Julien
 
P

Paul Lalli

Julien said:
I tried to specify the version in the use
clause to detect such problems in the future. However, perl 5.8.8
doesn't seem to handle this properly.
[user@host ~]$ perl -e 'use Class::Std 0.000009;'
[user@host ~]$ perl -e 'use Class::Std 1.000009;'
Class::Std version 1.000009 (v1.0.9) required--this is only version
0.000008 (v0.0.8) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

So we see that the installed Class::Std is version 0.0.8, but requiring
version 0.0.9 doesn't work (i.e. compilation did not fail). Requiring
v1.0.9 does lead to a compilation failure however.

Am I doing something wrong? It seems that leading 0's aren't being
handled properly under perl 5.8.8? Should I report this as a bug?

I can't duplicate your results with my perl, v5.8.4 solaris:

$ perl -MClass::Std -le'print $Class::Std::VERSION'
v0.0.8
$ perl -e'use Class::Std 0.000008'
$ perl -e'use Class::Std 0.000009'
Class::Std version 0.000009 (v0.0.9) required--this is only version
0.000008 (v0.0.8) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
$ perl -e'use Class::Std 1.000000'
Class::Std version 1.000 (v1.0.0) required--this is only version
0.000008 (v0.0.8) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
$ perl -v
This is perl, v5.8.4 built for sun4-solaris

Paul Lalli
 
S

Sisyphus

Julien said:
Hi,

After discovering that I was accidentally using Class::Std version
0.0.2 instead of 0.0.8, I tried to specify the version in the use
clause to detect such problems in the future. However, perl 5.8.8
doesn't seem to handle this properly.

I think it's conceivable that the problem *could* be a bug in the version
module. (I'm assuming that you're using different versions of version.pm in
the respective builds of perl.)

Try using the same version of version.pm in both your perl 5.8.6 and perl
5.8.8. If perl 5.8.6 and 5.8.8 still produce different results, then I'll
have to concede that it's probably a bug in perl 5.8.8. Otherwise, it's
probably a bug in version.pm.

Cheers,
Rob
 
J

Julien

Paul said:
I can't duplicate your results with my perl, v5.8.4 solaris:

Hi Paul,

Then this is evidence that the problem occurs starting with perl 5.8.8.

Julien
 
J

Julien

Sisyphus said:
I think it's conceivable that the problem *could* be a bug in the version
module. (I'm assuming that you're using different versions of version.pm in
the respective builds of perl.)

Well, I checked and indeed the version.pm module is different in each
case. Under perl 5.8.8 I am using version 0.430, and under perl 5.8.6
I am using version 0.670100. So I have an older version.pm in the
newer perl 5.8.8. Oops! (Each perl version in on a different
workstation actually).
Try using the same version of version.pm in both your perl 5.8.6 and perl
5.8.8. If perl 5.8.6 and 5.8.8 still produce different results, then I'll
have to concede that it's probably a bug in perl 5.8.8. Otherwise, it's
probably a bug in version.pm.

Upgrading to version.pm v0.680 fixed the problem under perl 5.8.8 :

user@host ~]$ perl -e 'use version 9.9'
version version 9.900 (v9.900.0) required--this is only version 0.680
(v0.680.0) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
user@host ~]$ perl -e 'use Class::Std 0.000009'
Class::Std version 0.000009 (v0.0.9) required--this is only version
0.000008 (v0.0.8) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

Thanks guys!

Julien
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top