References and their stringifications are unique as long as their data structure have not been released before.

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.

update

¹) 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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.