while (<$in>) { if $in =~ /^^/ { s/\^\^/\n^^/g; print $out $_; else { s/[a]|[c]|[t]|[g]{6}/^^\n }