in reply to Re: replacing text you have already replaced...
in thread replacing text you have already replaced...
This does work as advertised but probably different than you thought. You should have used warnings ;-), your regex is equivalent to $data =~ s/aa//g; and that is not what you had in mind, is it? A small typo is the cause, you print a but I think wanted to print 'a', the letter 'a' and not nothing to the filehandle a.
The important point is, pos() does not work with the substitution operator, only with m//g. See pos.
So I guess we have to make do with the 1 while s/// solution.
-- Hofmator
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: replacing text you have already replaced...
by wine (Scribe) on Jul 25, 2001 at 14:00 UTC |