# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #61130]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61130 >


The .subst method in Rakudo r33599 can understand :x()...

$ perl6 -e 'say "foo1foo2foo3foo4".subst("foo", "bar", :x(2))' # yes
bar1bar2foo3foo4

...and :nth()...

$ perl6 -e 'say "foo1foo2foo3foo4".subst("foo", "bar", :nth(2))' # yes
foo1bar2foo3foo4

...and :g...

$ perl6 -e 'say "foo1foo2foo3foo4".subst("foo", "bar", :g)' # yes
bar1bar2bar3bar4

...but not :x() together with :nth()...

$ perl6 -e 'say "foo1foo2foo3foo4".subst("foo", "bar", :x(2),
:nth(2))' # expected foo1bar2foo3bar4
foo1bar2foo3foo4

...and not :g together with :nth().

$ perl6 -e 'say "foo1foo2foo3foo4".subst("foo", "bar", :g, :nth(2))' #
expected foo1bar2foo3bar4
foo1bar2foo3foo4

The above are my personal expectations. The current version of S05 is
silent on how :nth() interacts with :x() and :g. There are spectests
for :g:nth but not (as far as I can see) for :x:nth.

Reply via email to