in reply to using subs in Log4perl config file

First off, I've got to tell you that calling L4p->init() in a package is not recommended.

init() should be called in the main program -- this is a L4p "best practice" to avoid you're loading several L4p-enabled modules, each of which clobbers the L4p configuration by calling init().

Secondly, subroutines in the L4p config file are called in the main name space. If you want to call a sub in a different package, just fully qualify it, like SomePackage::getCLI_Logfile().

Replies are listed 'Best First'.
Re^2: using subs in Log4perl config file
by dwhitney (Beadle) on Oct 22, 2004 at 21:51 UTC
    Hello saintmike,
    OK, point one I'll correct now.
    I'm sitting here with the L4P doc's and FAQ and I must be blind or something...
    Anyway, thanks!

    Point 2, I've tried to explicitly state SomePackage::getCLI_Logfile() in the config, and it still bombs.
      Then you've either got a typo in the call to the function or you didn't pull in the package ("use SomePackage") it is contained in before calling init(). What's the error message?
        Hey saintmike, sorry for the delay in responding to your reply. Anyway, took your ideas and applied them. Looks to work just fine! Thanks for your help!