Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- DateTime and Thread::Running conflict
December 31, 2008, 5:45 pm
rate this thread
(Thread::Running) hammer Perl's ability to poke through the file
guru> cat test
my $dt = DateTime->now( time_zone => 'local' );
Could not find file for 'DateTime::TimeZone::Local::Unix' at /usr/lib/
perl5/site_perl/5.8.8/load.pm line 256.
u> cat test
$dt = DateTime->now( time_zone => 'local' );
guru> l Unix.pm
-r--r--r-- 1 skendric users 7239 Nov 7 20:32 Unix.pm
Re: DateTime and Thread::Running conflict
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.
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
-------------------- 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