How do you print the address of objects with an overloaded stringification operator?
[prev]
[thread]
[next]
[Date index for 2005/04/29]
I've got a Class::DBI object which is being destroyed without saving
changes, and trying to track down where it's created.
Thus, I'm trying to find out what it's address is. Usually with a Perl
object, I'd just print it, because the stringification operator tells me
the memory address. But that's overloaded in Class::DBI.
I can of course:
My $oldClass =3D ref $object;
Bless $object, 'NO_CLASS';
Print $object;
Bless $object, $oldClass;
But this is about as ugly a kludge as you can get.
--
Dr Ian McDonald
Software Engineer, Interactive Drama & Entertainment
A300, 56-58 Wood Lane (CH), London W12 7SB
020 822 56162
ian.mcdonald@xxx.xx.xx / "Ian McDonald-ONLINE" (not "Ian MacDonald")
http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain
personal views which are not the views of the BBC unless specifically
stated.
If you have received it in error, please delete it from your system.=20
Do not use, copy or disclose the information in any way nor act in
reliance on it and notify the sender immediately. Please note that the
BBC monitors e-mails sent or received.=20
Further communication will signify your consent to this.
|
How do you print the address of objects with an overloaded stringification operator?
Ian McDonald-ONLINE 12:48 on 29 Apr 2005
|