Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

5.16 vs Date::Manip

by ChrisDennis (Sexton)
on Jun 17, 2012 at 20:29 UTC ( #976682=perlquestion: print w/replies, xml ) Need Help??

ChrisDennis has asked for the wisdom of the Perl Monks concerning the following question:

A Perl script of mine has stopped working since Arch Linux upgraded itself to Perl 5.16.

The difference can be demonstrated with this one-liner:

$ perl -e 'use Date::Manip; print Date::Manip::ParseDateString("10:20")."\n";'

On 5.10 (and 5.14, but I don't have a 5.14 system to hand), this gives:

2012061710:20:00

but with 5.16 I get:

Undefined subroutine &Date::Manip::ParseDateString called at -e line 1.

The system with Perl 5.16 has Date::Manip 6.32 installed.

Is this a bug or a feature in 5.16?

cheers

Chris

Replies are listed 'Best First'.
Re: 5.16 vs Date::Manip
by ikegami (Pope) on Jun 18, 2012 at 05:11 UTC
    You seem to have a badly installed Date::Manip. If you want to see the underlying problem, I bet it will be revealed by changing
    eval "require $backend; $backend->import(); return 1;";
    to
    eval "require $backend; $backend->import(); return 1;" or die $@;
    in the file returned by
    perl -E'require Date::Manip; say $INC{"Date/Manip.pm"};'
      Thanks for your reply. Your suggested tweak to Date/Manip.pm didn't make any difference.

      But after some other hacking, and making sure my Arch Linux system is fully up to date, I now get:

      Perl API version v5.14.0 of Storable does not match v5.16.0 at /usr/sh +are/perl5/core_perl/XSLoader.pm line 92. Compilation failed in require at /usr/share/perl5/vendor_perl/Date/Man +ip/Obj.pm line 13. BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/Date +/Manip/Obj.pm line 13. Compilation failed in require at /usr/share/perl5/vendor_perl/Date/Man +ip/Date.pm line 14. BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/Date +/Manip/Date.pm line 14. Compilation failed in require at ./brandysnap line 41. BEGIN failed--compilation aborted at ./brandysnap line 41.

      A bit of Googling reveals that 'Storable' ought to be part of core 5.16, so I don't know how to start fixing that.

        Perl API version v5.14.0 of Storable does not match v5.16.0 at /usr/sh +are/perl5/core_perl/XSLoader.pm line 92.

        It is kinda sad that this particular error gives you details about the full paths to a bunch of files but doesn't bother to include the two full paths that actually would be useful for diagnosing the problem. That is, it should tell you the full path to Storable.pm and to Storable.so (or whatever dynamic library it found to load).

        But, since the paths that it reports include

        /usr/share/perl5/core_perl/XSLoader.pm /usr/share­/perl5/ven­dor_perl/D­ate/Manip/­Obj.pm

        It seems clear that the instance of Perl you installed puts module files into a directory structure that is not specific to one version of Perl. That is a very old idea that I find, these days, is just never worth the headaches it causes.

        Likely, the version of Storable.pm that you wanted either got overwritten when a different version of Perl was installed (that stupidly shared the same /usr/share/perl5 directory structure) or (seems less likely) just gets ignored because the version of Storable.pm that you don't want gets found first due to the order of directories listed in @INC.

        My suggestion is to uninstall all versions of Perl except the one included with the operating system, force a re-install of the Perl included in the operating system, and make sure that any other versions of Perl that you install don't touch nor look at any of the directories where the system Perl stores modules.

        - tye        

Re: 5.16 vs Date::Manip
by moritz (Cardinal) on Jun 17, 2012 at 21:03 UTC
Re: 5.16 vs Date::Manip
by cavac (Curate) on Jun 17, 2012 at 21:55 UTC

    Did you, by any chance, install a pre-packaged module (versus one installed from source by the cpan shell or similar)?

    Try to reinstall the module. If cpan install Date::Manip says it's current and it still doesn't work (had something similar a few times with ActivePerl), try this to see whats going on:

    cpan look Date::Manip perl Makefile.PL make test make install # Might have to use sudo make install # (depends where your perl modules are installed) make distclean exit exit

    "You have reached the Monastery. All our helpdesk monks are busy at the moment. Please press "1" to instantly donate 10 currency units for a good cause or press "2" to hang up. Or you can dial "12" to get connected directly to second level support."
Re: 5.16 vs Date::Manip
by Khen1950fx (Canon) on Jun 18, 2012 at 07:33 UTC
    FWIW, I have 30 versions of perl from 5.8.8 to 5.17.0 installed. I tested Date::Manip on all 30 versions---all passed.
    #!/usr/bin/perl BEGIN { $| = 1; $ENV{'DM6'} = 1; $ENV{'TI_MODE'} = 'inter'; } use strict; use autodie; use warnings FATAL => 'all'; use CPAN; use Test::Inter; use Date::Manip; my $t = new Test::Inter; $t->feature( print "Perl: $]\n" ); $t->feature( print "OS: $^O\n" ); if ( $Test::Inter::VERSION eq 1.03 ) { $t->feature( print "Test::Inter: ", $Test::Inter::VERSION, "\n"); } if ( $Date::Manip::VERSION eq 6.32 ) { $t->feature( print "Date::Manip: ", $Date::Manip::VERSION, "\n"); $t->feature(print Date::Manip::ParseDateString("10:20"), "\n"); } else { CPAN::Shell->install( Task::DualLived Test::Inter Date::Manip)); }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://976682]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2021-04-14 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?