find . -name "*.html" -type f -print0 | perl -i -p0e \ 'BEGIN{ @ARGV = ; chomp @ARGV; $/ = \65536 }; \ while (<>) { s/foo/bar/g; print }'