perl -pe"s/-\w{2,}/ /g" infile > outfile #### perl -i.bak -pe"s/-\w{2,}/ /g" file #### while (<$fh_in>) { s/-\w{2,}/ /g; print $fh_out $_; }