in reply to Using Perl Regex to find & replace large chunks in code
As a standalone script
local $/; my $search = <>; my $replace = <>; #local $^I = ''; # No backups. local $^I = '~'; # Make backups. while (<>) { s/\Q$search/$replace/g; print; }
Usage:
or$ script.pl - - *.cstol search search search ^D replace replace replace ^D
$ script.pl search.txt replace.txt *.cstol
You can tweak $search's content as the linked node did if you so desire (but get rid of \Q if you do).
|
---|
In Section
Seekers of Perl Wisdom