Juerd skribis 2004-05-12 20:15 (+0200):But I think I still want to have some non-mutating version of s/// that returns the modified string, so that you can just write something like print s:gx/\w+/WORD/ for <>;
Actually, can't we just use the . for s///?
You'd then use $foo.s/// to get the new string ang $foo.=s/// to mutate $foo.
Working from the other direction, parens are not valid pattern delimiters, leaving s() open for use:
print s(/:g \w+/, 'WORD');
(Or somesuch...dunno about the positioning of :g.)
-- Brent "Dax" Royal-Gordon <[EMAIL PROTECTED]> Perl and Parrot hacker
Oceania has always been at war with Eastasia.