Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-26 00:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found