My question is: how is the expression in $hash{expression} stringified?

perldata says anything more complicated than a simple identifier inside a hash subscript will be interpreted as an expression but it doesn't say how such an expression is stringified.

I recently (just this week, after many years of using perl) came across the subscript separator, nicely described in perlvar.

The form of the expression I was trying to understand was $href->{$x,$y}.

I spent many hours looking for an explanation of this syntax before a fortuitous google search turned up the entry in perlvar, where I don't think I ever would have looked on my own.

I had looked in perlsyn, perldata and perlop and searched extensively on-line without finding a description of this form. Was I missing something?

It would have helped me tremendously (as in, saving me many hours of searching) had the perldata man page mentioned, where it describes how the content of the curlies is forced to be a string, somethinge about $; and multidimensional array emulation.

So, now I am wondering if there is a better reference to perl syntax and semantics for perl 5.8.8 than perldata, perlsyn and perlop. Any suggestions?

Also, how should I, if I were so bold, suggest an improvement to the standard documentation?


In reply to hash key stringification by ig

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.