From: James.FitzGibbon <Jam...@ta...> - 2003-05-01 16:59:31
|
In Log::Log4perl::Config::config_read, this code is used to determine if a hashref of key/value pairs has been passed to Log::Log4perl::init: if (ref($config) eq 'HASH') { # convert the hashref into a list Unfortunately, our in-house confiugration module uses tied hashes blessed into their own class. So this check fails and init() throws an exception because we haven't given it a scalar reference. I would suggest changing this to: if( UNIVERSAL::isa($config, 'HASH') ) { This technique should work as long as the underlying data structure being passed in is a hash, and should be backwards compatible a ways back. If compatibility isn't as much of a concern, the 'reftype' function works nicely too, but that is only in the attributes pragma in 5.6.1 and Scalar::Util in 5.8.0. Thanks. -- j. James FitzGibbon Consultant, Ajilon Services, TTS-3D@CC-950 jam...@ta... voice/fax 612-304-6121/3277 |