Skip Menu |

This queue is for tickets about the Template-Toolkit CPAN distribution.

Report information
The Basics
Id: 66128
Status: resolved
Priority: 0/
Queue: Template-Toolkit

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.22
Fixed in: (no value)



Subject: replace vmethod should support braced capture variables (e.g. ${1})
Currently there's no way to express something like the following with TT2's replace vmethod: s/(...)/${1}012/; One could try to write text.replace('(...)', '$1' _ '012') but this does not work because the 2nd argument is completely evaluated first and then passed to the replace vmethod. So the vmethod just sees '$1012' as 2nd argument, which is obviously wrong. A workaround for this problem could be the introduction of "braced" capture variables. So one could write instead: text.replace('(...)', '${1}' _ '012') or even text.replace('(...)', '${1}012') I can provide a patch if this is accepted. Regards, Slaven
Ticket migrated to github as https://github.com/abw/Template2/issues/104