On Wed, May 23, 2001 at 11:18:30AM -0500, Jay Strauss wrote:
> I have two variables:
>
> my $fromuser = "CRPCTL";
> my $touser = "CT7333";
>
> I have a text file with a bunch of "CRPCTLI"s in it, and want to change them
> to "CT7333_I". But I can't form the proper regex:
>
> I tried
>
> s/$fromuser."I"/$touser."_I/g;
> s/"$fromuserI"/"$touser_I"/g;
> s/$fromuser\."I"/
>
> I don't want to have to do:
> $search = $fromuser."I";
> $replace = $touser."_I";
>
> s/$search/$replace/g;
>
> Jay
>
> Jay Strauss
> [EMAIL PROTECTED]
Must you use perl? Why not:
sed 's/CRPCTLI/CT7333_I/g'
?
Micah