in reply to Multiple lines replacement using s###g;
To create a pattern that matches a string literally, use quotemeta, also available as \Q..\E.
my $f1 = <<'__EOI__'; //*********************************** //* Filename: Config1.c //* Comment: [F1] is replaced by [F2] //* //*********************************** __EOI__ my $f2 = <<'__EOI__'; /***********************************/ /* Filename: Config2.c */ /* Comment: [F2] replace [F2] */ /* */ /* */ /***********************************/ __EOI__ s/\Q$f1/$f2/g;
|
|---|