while (<$input_fh>) { print $output_fh 'aaaa' unless /^>/; print $output_fh $_; }