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

I'm trying to use Time::HiRes in a script, but get a message saying the 'local module' may not be supported?

THis is from ActivePerl 820 with Time-HiRes 1.49 installed.

Have to admit I'm not clear on Local modules.

Replies are listed 'Best First'.
Re: Local Module for Time-Hires?
by ikegami (Patriarch) on Jun 29, 2007 at 15:24 UTC

    That's odd, ActivePerl v5.8.8 build 820 comes with Time::HiRes 1.86. What makes you think the version of yours is 1.49?

    >perl -v This is perl, v5.8.8 built for MSWin32-x86-multi-thread (with 50 registered patches, see perl -V for more detail) ... Binary build 820 [274739] provided by ActiveState http://www.ActiveSta +te.com Built Jan 23 2007 15:57:46 ... >perl -e "use Time::HiRes; print Time::HiRes->VERSION 1.86

    Also, I can't find that error in perldiag. Could you show us the minimal code that causes this error and the exact error message?

      "Time::HiRes object version 1.49 does not match $Time::HiRes::XS_VERSION 1.86 at C:/Perl/lib/DynaLoader.pm line 253."

      Looks like its a problem with IIS5.

      I stripped out and reinstalled AP 820 and changed the code from eval { require Time::HiRes; import Time::HiRes qw(time); }; to use Time::HiRes qw(time); seems fine now.

        Time::HiRes object version 1.49 does not match $Time::HiRes::XS_VERSION 1.86 at C:/Perl/lib/DynaLoader.pm line 253.

        Perl was finding the .pm for v1.49 and the .dll for v1.86. It was a bad install or a bad lib path.

        eval { require Time::HiRes; import Time::HiRes qw(time); };

        I think you need to overload internals at compile-time, so you'd have to use

        BEGIN { eval { require Time::HiRes; import Time::HiRes qw(time) } }
        or
        BEGIN { eval 'use Time::HiRes qw(time)' }

        By removing the eval, you removed the ability to fall back onto the lower-precision CORE::time if Time::HiRes isn't installed.

Re: Local Module for Time-Hires?
by Anonymous Monk on Jun 30, 2007 at 00:50 UTC
    Cut and paste error messages