Hello,
sorry about the dumb question but I'm not sure I understand the
<at($pos)> assertion.
If I write something like
my $s="hello"
s/<at(1)>/a/
I expected it to give me
"hallo"
whereas it give ms
"haello".
Does it mean that basically the assertion is a character/string property
instead of the character/string itself?
Also, what is the correct way to replace the i-th character in a Str ?
I can do (well, I can't cause pugs doesn't have subst, it seems)
"str".subst(/<at($i)>./,$other)
but it seem unnecessarily verbose.
Is there something else builtin?
If not, wouldn't it be better if Str.subst could accept Ints and Ranges
as the first argument?