in reply to Editing HTML files

It sounds like you could do this with a regular expression.
use File::Slurp; sub fix_file { my $html = read_file($_[0]); my $replacement = ...read in replacement string... if ($html = s{<div align="center">nothing</div>} {<div align="center">$replacement</div>}) # use g modifier? { ...write file... } }

Replies are listed 'Best First'.
Re^2: Editing HTML files
by GertMT (Hermit) on Jul 08, 2008 at 21:09 UTC
    or make a backup just to make sure and then while in the directory with the html files maybe:
    perl -pi -e 's/find/replace/g' *.html