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")␤»
my $fruit = 'bananas';
dd %h«oranges "$fruit"»;
# OUTPUT: «("round", "bendy")␤»
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.
-
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.
|