while ( <$fh> ) { # protect against most egregious HTML violations s/&/&/g; s//>/g; # mark upper-case words as italic. not locale-safe. s!\b([A-Z])+\b!$1!g; # output the result print $fh $_; }