From: Kevin G. <ke...@go...> - 2004-05-13 18:09:24
|
Mike Schilli wrote: > Dennis Gregorovic wrote on 5/13/2004, 7:41 AM: > > it is assuming that $/ is set to "\n", which would result in @text > > containing an entry for each line in the config file. > > Ah, ok, now I understand. However, tinkering with $/ without limiting > its scope is considered bad style. "perldoc perlvar" shows: Mike, I think the problem Dennis is pointing out is that a user might do something like this: open (F, 'somefile'); $/ = undef; $somefile = <F>; #slurp the whole file Log::Log4perl::init('myconfig.conf'); In which case our init will fail since the user has (however ill-advisedly) tinkered with $/, and we are assuming $/ is still "\n" Dennis' proposal protects us from the user's tinkering. -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |