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

Discussion in 'Perl Misc' started by Julien, Jan 4, 2007.

  1. Julien

    Julien Guest

    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
     
    Julien, Jan 4, 2007
    #1
    1. Advertising

  2. Julien

    Paul Lalli Guest

    Julien wrote:
    > 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
     
    Paul Lalli, Jan 4, 2007
    #2
    1. Advertising

  3. Julien

    Sisyphus Guest

    "Julien" <> wrote in message
    news:...
    > 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
     
    Sisyphus, Jan 5, 2007
    #3
  4. Julien

    Julien Guest

    Paul Lalli wrote:
    > 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
     
    Julien, Jan 10, 2007
    #4
  5. Julien

    Julien Guest

    Sisyphus wrote:
    > 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
     
    Julien, Jan 10, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jan
    Replies:
    2
    Views:
    1,482
    Mike Treseler
    Dec 16, 2004
  2. Peter Jansson
    Replies:
    5
    Views:
    6,437
    Ivan Vecerina
    Mar 17, 2005
  3. Vinu
    Replies:
    4
    Views:
    394
    Jim Langston
    Jul 7, 2005
  4. V Green
    Replies:
    0
    Views:
    928
    V Green
    Feb 5, 2008
  5. PA Bear [MS MVP]
    Replies:
    0
    Views:
    1,039
    PA Bear [MS MVP]
    Feb 5, 2008
Loading...

Share This Page