in reply to Re (tilly) 1: What is HASH(0x17653d4) for?
in thread What is HASH(0x17653d4) for?
So a new entity gets a new string. That's all fine with me. Suppose $c = $d = new Something. Then $c and $d point to the same memory location and have the same stringification. Everything as expected. The DESTROY will delete the key if the object dies.
Until now it sounds like I can use stringified refs to identify an object. Except for this: is it possible that the stringification changes only by time or by adding/deleting/changing data in the underlying object? The keys wouldn't reliably identify the object anymore.
Assuming this doesn't happen wouldn't that be interesting for certain modules, like CGI.pm? $query->{name} would be $query->param('name') an keys %$query would contain nothing else but param() because extra information that is used by the module's subroutines can be outsourced to a hash with ref-strings as keys. $query would act like a normal hash reference and still be blessed to the modules subroutines. I already see myself experimenting with this alot.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 3: What is HASH(0x17653d4) for?
by tilly (Archbishop) on Nov 02, 2001 at 02:21 UTC | |
by fokat (Deacon) on Nov 02, 2001 at 03:16 UTC |