Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Periodically, I dip into perl6, but haven't now in quite some time. However, I do vaguely recall being bit by this, and I believe I got the answer on IRC.

I can't find any clear documentation that states that <> doesn't interpolate, other than a very vague portion of the Class Hash doc:

The general Subscript rules apply providing shortcuts for lists of lit +eral strings, with and without interpolation. my %h = oranges => 'round', bananas => 'bendy'; dd %h<oranges bananas>; # OUTPUT: «("round", "bendy")&#9252;» my $fruit = 'bananas'; dd %h«oranges "$fruit"»; # OUTPUT: «("round", "bendy")&#9252;»

So it appears as though one needs to use <<>> for interpolation if you're using <> notation.

There's no mention explicitly that <> does not interpolate, unless I'm searching incorrectly.


In reply to Re: Small Perl 6 discoveries IV, hash access by stevieb
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":



  • 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 imbibing at the Monastery: (5)
As of 2024-03-28 12:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found