DateTime and Thread::Running conflict

S

skendric

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
 
X

xhoster

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.
 

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

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top