in reply to Removing empty line(s) with regex in a multiple strings in a variable

Works for me, sort of. At least it gets rid of all the newlines leaving
'AAGTAATCAAGTATTACAAGAAACAAAAATTCAAGTAAATAACAGATAATATGTCAAAAGCTGTCGGTA +TTGATTTAGGTACAACATACTCGTGTGTTGC>YDR256CCTA 1969666970216GGGAAGAACTAAGAGATGTTATGGCTCGGAGAGTTTTGAAAAGCGAAATAGATTCGC +TGCAAGTTTGTGAAGAAACCATCGACAAGAATTACAAGGTTAT';
What are you seeing? If you just want to compress multiple newlines, you could use $str =~ y/\n//s; If there are space characters on the "blank" line, you'd want something like $str =~ s/^\s+//mg; (or $str =~ s/^\s+\n//mg; if there may be spaces at the start of a non-blank line).