|
From: Eric W. <scr...@gm...> - 2007-01-24 01:29:13
|
Hi
(sorry, I'm not on the list, please cc replies)
I've run into a bug in Log::Log4perl::Util::module_available when
running in a par environment. This may be an issue with PAR, but I
have to guess that most @INC subroutine hooks are not expecting to be
called directly.
The problem comes up in Log::Log4perl::Layout::PatternLayout (though I'm
sure it could happen elsewhere in different circumstances.) Basically,
the module_available call returning true upsets the delicate balance of
things (I'm guessing because the @INC hook sets an entry in %INC, which
stops any further requires from actually loading the code.)
if(Log::Log4perl::Util::module_available("Sys::Hostname")) {
require Sys::Hostname;
$HOSTNAME = Sys::Hostname::hostname();
}
I'm wondering if there's some reason that cannot simply be an eval
{ require Sys::Hostname}, (possibly checking that the error is m/^Can't
locate Sys\/Hostname\.pm/ rather than some compile error.)
Thanks,
Eric
--
"Insert random misquote here"
---------------------------------------------------
http://scratchcomputing.com
---------------------------------------------------
|