Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: hash key

by sundialsvc4 (Abbot)
on May 30, 2017 at 14:06 UTC ( #1191592=note: print w/replies, xml ) Need Help??


in reply to hash key

Yes, the “quotes in Perl” page previously mentioned is very important, such that I fear that some of the preceding responses might actually contain misinformation.   (Specifically, the notion that the hash-key contains quote-marks.)

(However, as is my custom, I did not downvote these – or any – posts.)

When a string literal is enclosed in “double” quotes, Perl looks within the content of that string for things ... such as variable-names, object/class references, and so forth ... that it can so-called interpolate.   (The interpolated value is what is subsequently used, as a hash-key or otherwise.)   Whereas, when ‘single’ quotes are used, interpolation does not occur.   Therefore, if you observe a difference depending on which type of quote is used, you know that interpolation is the root cause.

Interpolation only applies to string literals that appear in the source code.   A string variable may contain any value at all, and interpolation will not be applied to that value unless you explicitly cause this to happen.

Replies are listed 'Best First'.
Re^2: hash key
by jdporter (Canon) on May 30, 2017 at 20:50 UTC
    A string variable may contain any value at all, and interpolation will not be applied to that value unless you explicitly cause this to happen.

    How does one cause that to happen?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1191592]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2020-08-13 21:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (75 votes). Check out past polls.

    Notices?