I don't know if it's implemented yet, but you should be able to make that last line:
say@l[$i...];
Again, Pugs knows better...:-) It does not seem to work with the current svn build.
say@l[(@l>9??@l-10::0)...];
Yes, I tried similar solution myself, too, but Pugs does not let me to incorporate the ternary operator into the array index. What is pretty interesting playing around with Pugs is that usually it proves itself much more flexible in parsing complex Perl 6 statements than I would have expected it, but every now and then even the simplest ideas fail with some obscure error messages. It is getting better all the time, though.
-
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.
|