DateTime and Thread::Running conflict

Discussion in 'Perl Misc' started by skendric@fhcrc.org, Dec 31, 2008.

  1. Guest

    how do i trouble-shoot this? conceptually, how can one module
    (Thread::Running) hammer Perl's ability to poke through the file
    system?

    guru> cat test
    #!/usr/bin/perl
    use DateTime;
    use Thread::Running;
    my $dt = DateTime->now( time_zone => 'local' );
    guru>./test
    Could not find file for 'DateTime::TimeZone::Local::Unix' at /usr/lib/
    perl5/site_perl/5.8.8/load.pm line 256.
    guru>

    gur
    u> cat test
    #!/usr/bin/perl
    use DateTime;
    #use Thread::Running;
    $dt = DateTime->now( time_zone => 'local' );
    guru> ./test
    guru>

    guru> pwd
    /usr/lib/perl5/site_perl/5.8.8/DateTime/TimeZone/Local
    guru> l Unix.pm
    -r--r--r-- 1 skendric users 7239 Nov 7 20:32 Unix.pm
    guru>

    --sk

    stuart kendrick
    fhcrc
    , Dec 31, 2008
    #1
    1. Advertising

  2. Guest

    wrote:
    > how do i trouble-shoot this? conceptually, how can one module
    > (Thread::Running) hammer Perl's ability to poke through the file
    > system?


    It looks to me like the problem is that Thread::Running invokes "use load",
    which causes module loading to be delayed until a function from that module
    is actually used. Part of this delay is (apparently) that %INC doesn't get
    updated when the "use" is compiled.

    While the DateTime module expects to load all of it's modules up front, and
    based on that it inspects %INC to see if a module has already been loaded.
    Or something like that.

    These two behaviors are incompatible. I don't know why either module does
    either of these rather weird (to me) things. I could be wrong in the
    details of the above, it is just my first impression.


    > guru> cat test
    > #!/usr/bin/perl
    > use DateTime;
    > use Thread::Running;


    To reproduce your problem, it is sufficient to have "use load;" rather
    than "use Thread::Running".

    Sorry, I don't have a solution, but I hope I've helped narrow down where
    to look.

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    The costs of publication of this article were defrayed in part by the
    payment of page charges. This article must therefore be hereby marked
    advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
    this fact.
    , Jan 2, 2009
    #2
    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. Christos TZOTZIOY Georgiou
    Replies:
    3
    Views:
    675
    Christos TZOTZIOY Georgiou
    Sep 13, 2003
  2. Tim Peters
    Replies:
    0
    Views:
    513
    Tim Peters
    Sep 9, 2003
  3. mp
    Replies:
    1
    Views:
    368
    John Machin
    Jul 28, 2006
  4. Martin
    Replies:
    0
    Views:
    315
    Martin
    Dec 27, 2008
  5. Replies:
    2
    Views:
    736
    M.-A. Lemburg
    Jan 6, 2009
Loading...

Share This Page