From: Roland B. <rol...@ff...> - 2003-09-25 21:28:15
|
The following patch will make "$ENV{HOME}/log4perl.conf" the default file for the init method if it is called without parameters. What do you think about having a default config file? - Roland #------------------------------------- --- Config.pm_org Mon Aug 11 07:03:28 2003 +++ Config.pm Thu Sep 25 23:07:31 2003 @@ -495,6 +495,12 @@ $res->message." "; } }else{ + unless (defined $config) { + my $default = "$ENV{HOME}/log4perl.conf"; + # BETTER: + # my $default = catfile($ENV{HOME} || die, 'log4perl.conf'); + $config = $default if -f $default; + } open FILE, "<$config" or die "Cannot open config file '$config'"; @text = <FILE>; close FILE; #------------------------------------- -- Roland Bauer http://www.fff.at/contact/ |