####
####
#!/usr/bin/perl
use warnings;
use strict;
use File::Find::Rule;
#find all html files in specified directory
#this is for a specific directory right now for testing, but
#will eventually be going through all the subdirectories under /htdocs
my $dir = "/home/devcorp/htdocs/plan/norms";
my $rule = File::Find::Rule->file->name("*.html")->start( $dir );
#keep track of the changed files in a file
open(OUTFILE,">changed_files.txt") || die "cant open changed_files.txt, $!\n";
while ( my $html_file = $rule->match ) {
#open file to replace string in
open FILE, "<$html_file";
my @lines = ;
for (@lines) {
#replace
#with
if (s///){
my $result = $1;
#print the file changed and the document path for the included file
print OUTFILE "$html_file: $result\n";
}
}
close FILE;
}
close OUTFILE;