in reply to Using 'e' in s///

s/$1/ .... /;
You cannot modify the match variables, anyway. You need a different approach.
Err, oh dear.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: Using 'e' in s///
by sauoq (Abbot) on Aug 14, 2003 at 01:04 UTC
    You cannot modify the match variables, anyway.

    That's not an attempt to modify $1 at all. It's an attempt to use it as a pattern, which is fine.

    $ perl -le '$_="foo"; /(o)/; s/$1/x/; print' fxo
    You seem to have confused that with $1 =~ s/.../.../;

    -sauoq
    "My two cents aren't worth a dime.";