On Thu, Dec 12, 2002 at 05:23:51PM -0800, David Wheeler wrote:
> On Thursday, December 12, 2002, at 05:09  PM, Tim Bunce wrote:
> 
> >It's discouraged for general use, but not unreasonable here.
> 
> Okay, great!
> 
> >But any good reason why you don't just take a copy of the handle?
> 
> Um, what do you mean? Is there a method to do that? Or do you just mean 
> a hash copy?
> 
>   my @params = %$dbh;
> 
> Frankly, that didn't occur to me. Duh.

Actually I meant just a copy of the reference. Then add accessor methods
to lookup the value from the handle. Would be much faster as few uses would
access all those attributes.

An extra method to 'freeze' (copy) the attributes could be added
and called in situations where the exception object would be longlived
and the user wanted to protect against the underlying handle attributes changing.

> The one reason I might to do it, 
> however, is that I change the key names of some of the attributes -- to 
> make them all lowercase and to use underscores to separate words. More 
> the Perl style for the Exception object accessors, that way.

But arguably inconsistent for this application.

Tim.

Reply via email to