Though, it's an odd use of s///r in p5 and subst in p6, when all it is
doing is prepending a string!
.say for (325, '44a', 555, 6).grep(/^\d+$/).map( '4' ~ * )
-y
On Mon, Jun 10, 2019 at 11:01 PM yary wrote:
>
> Or if you need to "map" the substitution
>
> .say for (325, '44a', 555, 6).grep(/
Or if you need to "map" the substitution
.say for (325, '44a', 555, 6).grep(/^\d+$/).map( *.subst(/^/,4) )
-y
On Mon, Jun 10, 2019 at 10:54 PM yary wrote:
>
> p6 can transliterate from p5 rather literally
>
> say .subst(/^/,4) for grep /^\d+$/, (325, '44a', 555, 6);
>
>
>
> -y
>
> -y
>
>
> On
p6 can transliterate from p5 rather literally
say .subst(/^/,4) for grep /^\d+$/, (325, '44a', 555, 6);
-y
-y
On Mon, Jun 10, 2019 at 9:19 PM Marc Chantreux
wrote:
>
> hello people,
>
> in perl5, i can
>
> print for
> map s/^/4/r,
> grep /^\d+$/,
>
hello people,
in perl5, i can
print for
map s/^/4/r,
grep /^\d+$/,
the perl6 version is a Seq, so much more memory friendly
but i expected (and haven't found in the documentation)
a short equivalent of s///r so the shorter i have is:
$*ARGFILES