in reply to Pattern Substitution..
Note that if all you are trying to do is replace one character with another, it's much easier to use tr than s. For example:
(update not like this as japhy points out...$new_string = "good food"; $new_string =~ tr/od/ek/;
) will give you "geek feek", with 'o' converted to 'e', and 'd' converted to 'k'.$new_string = ( "good food" =~ tr/[od]/[ek]/; );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Pattern Substitution..
by japhy (Canon) on May 30, 2001 at 18:31 UTC |