You should never use a memory-address as a “key.”
Have you heard of inside-out objects? At the base, they do exactly what just proclaimed shouldn't be done.
{ my %objs; sub new { my $obj = { ... }; my $key = 0+$obj; $data{$key} = $rec; return $key; } }
(Blessing omitted for clarity.)
I don't know to what side-effect you are referring. That numification of a reference returns its address? That's safe.
In reply to Re^2: Address of anonymous hash
by ikegami
in thread Address of anonymous hash
by aixtal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |