in reply to String Replace

Your issue is that '?' is a control character in regular expressions - it means match zero or one of the preceding character/pattern. You need to escape the '?' to get a literal '?', i.e.:

$temp1='http://test.com/web/main\?'; $temp2='https://test.com/web1/test1'; $proc_string =~ s/$temp1/$temp2/g;

See Regular Expressions, in particular the section on quantifiers, for details.

Replies are listed 'Best First'.
Re^2: String Replace
by Anonymous Monk on Jun 17, 2009 at 18:24 UTC
    Thank you. That worked.