Don't ask to ask, just ask | |
PerlMonks |
Re^5: Allocation of anonymous arraysby LanX (Saint) |
on Feb 08, 2014 at 16:19 UTC ( [id://1074040]=note: print w/replies, xml ) | Need Help?? |
I agree about encapsulation, thats why I mentioned Tie::Hash after demonstrating the raw mechanics in a REPL. If tied or functional or OO or whatever interface... YMMV! :) Anyway we are again speculating about the OPs real intention, he just showed us enough to think it's pointless for most thinkable motivations. So pointless that Perl could/should warn about using literal arrays or hashes as keys...
updatetl;dr ... I just used a reverse in my example to avoid triviality with a minimal amount of code, it was a workaround not a goal. The general problem is to use complex data-structures as keys, see also Using hashes for set operations... for a similar discussion.
Cheers Rolf ( addicted to the Perl Programming Language)
In Section
Seekers of Perl Wisdom
|
|