in reply to Replace Strings
Based on what you've provided, you can simply put your old and new URLs into variables and do the substitution the same way as you did with s/ABC/CDE/g. Here it is on the commandline:
ken@ganymede: ~/tmp $ perl -Mstrict -Mwarnings -E ' > my $line = q{blah blah https://abc.net/cm/one blah blah}; > my $old_url = q{https://abc.net/cm/one}; > my $new_url = q{https://abcde.net/dm/two}; > $line =~ s/$old_url/$new_url/g; > say $line; > ' blah blah https://abcde.net/dm/two blah blah
-- Ken
|
|---|