in reply to Read from a file and replace
Rudif#!perl -w use strict; use File::Slurp; my $find = quotemeta("here.company.com/pagedir"); my $replace = "there.company.com/"; my @lines = read_file "file.html"; foreach (@lines) { s/$find/$replace/g; } write_file "newfile.html", @lines;
|
|---|