But the deeper problem like others already mentioned, must be stressed out:
Perl has no way to get a reference from it's stringification!It's a one way street...
Then reversing this hash is like treating a marijuana addict with cocaine.
This whole technique is pointless as long as you don't manually store a lookup-hash to be able to transform key-string to ref.
DB<107> $aref=[1,2,3]; $lookup{$aref}=$aref => [1, 2, 3] DB<108> \%lookup => { "ARRAY(0x8ffd450)" => [1, 2, 3] }
Tell your colleague there is no way to use literal arrays here cause the information gets lost.¹
Cheers Rolf
( addicted to the Perl Programming Language)
PS: as a side note, Python allows other data-types to be keys, but only if they are immutable ... like literal strings are.
¹) As long as he doesn't use a tied hash from a fancy CPAN module
In reply to Re: Allocation of anonymous arrays
by LanX
in thread Allocation of anonymous arrays
by OwlHoot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |