From: Mike S. <m...@pe...> - 2007-01-26 06:15:04
|
On Tue, 23 Jan 2007, Eric Wilhelm wrote: > 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. Hi Eric, to work around issues with PAR, this FAQ shows a couple of tricks: http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4perl/FAQ.html#9ea64 > 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.) Not quite sure I understand the problem ... what's the error message you're getting? -- Mike Mike Schilli m...@pe... > > Thanks, > Eric > -- > "Insert random misquote here" > --------------------------------------------------- > http://scratchcomputing.com > --------------------------------------------------- > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |