in reply to Allocation of anonymous arrays
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Allocation of anonymous arrays
by AnomalousMonk (Archbishop) on Feb 07, 2014 at 15:44 UTC | |
by LanX (Saint) on Feb 07, 2014 at 16:11 UTC | |
by AnomalousMonk (Archbishop) on Feb 08, 2014 at 16:07 UTC | |
by LanX (Saint) on Feb 08, 2014 at 16:19 UTC |