Interesting, seems to work fine. Verify the
contents of $was and $is and then try this:
($newstring = $_) =~ s/$was/$is/;
print ("Newstring is: $newstring\n");
Cheers,
Carter.
> -----Original Message-----
> From: Jacobson, Karl [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 14, 2002 3:46 PM
> To: [EMAIL PROTECTED]
> Subject: regexp
>
>
> I am trying simply to do a search and replace and have
> identified the string
> that I want to replace with another.
>
> $_ holds the string to be manipulated
> $was holds the search string (split from an input file)
> $is holds the replacement string (also split from an input file)
>
> s/$was/$is/; doesn't work and I expected that it would. What
> is missing?
>
> Karl
>
>
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs