Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
There's no mention explicitly that <> does not interpolate, unless I'm searching incorrectly.
I am relatively sure that I have seen it somewhere in the past, but I am not able to recall where.

Having said that, I think it is sort of indirectly said in the https://docs.perl6.org/language/quoting documentation:

In https://docs.perl6.org/language/quoting#Word_quoting:_%3C_%3E about the <> word quoting angle brackets:

The angle brackets quoting is like qw

So, if you know qw// in P5 and are willing to take the chance that it works similarly in P6, you've basically have your response. But we all know that P5 and P6, albeit quite similar, are not the same. So, how does qw works in P6? In https://docs.perl6.org/language/quoting#Word_quoting:_qw:

The :w form, usually written as qw, splits the string into "words". In this context, words are defined as sequences of non-whitespace characters separated by whitespace. The q:w and qw forms inherit the interpolation and escape semantics of the q and single quote string delimiters, whereas Qw and Q:w inherit the non-escaping semantics of the Q quoter.

So, qw inherit the interpolation and escape semantics of the q and single quote string delimiters. Now, you have the answer.

And just in case you're not sure what the interpolation semantics of the q and single quote string delimiters, you can move one step further and look at the q semantics in https://docs.perl6.org/language/quoting#Escaping:_q, which does escaping but no interpolation, as opposed to qq which does interpolation (https://docs.perl6.org/language/quoting#Interpolation:_qq) and to Q (https://docs.perl6.org/language/quoting#Literal_strings:_Q), which produces as literal string as possible.

So, all in all, stevieb, it is really obvious. ;-) (Just kidding, of course.)

Oh, BTW, back to the OP, the behavior is also documented in https://docs.perl6.org/language/operators#index-entry-hash_indexing_operator-hash_subscript_operator-hash_indexing_operator:

Shortcut for postcircumfix { } that quotes its argument using the same rules as the quote-words operator of the same name.
So, again, it is just obvious. ;-)

In reply to Re^2: Small Perl 6 discoveries IV, hash access by Laurent_R
in thread [Perl6] Perl 6 discoveries IV, hash access by holli

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, 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, 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.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (2)
    As of 2021-05-06 23:12 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Perl 7 will be out ...





      Results (81 votes). Check out past polls.

      Notices?