Re: copying and s/// (was Re: Overlapping RFCs 135 138 164)
[email protected] ("David L. Nicol")
| Newsgroups | perl.perl6.language.regex |
|---|---|
| Organization | University of Missouri - Kansas City supercomputing infrastructure |
| Message-ID | <[email protected]> |
Uri Guttman wrote:
> but we need a better syntax for s/// that doesn't modify its string but
> returns a copy which has had the substitution applied to it. possibly a
> s/// modifier?
>
> $new = $old =~ s/foo/bar/n ;
>
> n for new?
if our internal string representation could grow from the middle
instead of being a single malloc, there wouldn't be the performance
hit you get from
($new = $old) =~ s/foo/bar/
or maybe it is that you just abhor parentheses?
--
David Nicol 816.235.1187 [email protected]
Subroutine one-arg, him called no-arg, get $_-arg. Ug.