in reply to change \n to \t
TIMTOWTDI. I'd abandon the array unless you need it for something else.
#!/usr/bin/env perl use strict; use warnings; my $text; { local $/ = undef; $text = <DATA>; } $text =~ s/\n(?!>)/\t/g; print "$text\n"; __DATA__ >1 AGTCGTAGCAT >2 TGAGCTACG >3 GGCATAGN >4 CGCACNCAGCTACACC >5 NGATAGCTACA
This approach uses a negative look-ahead. It replaces a newline not followed by an angle bracket with a tab. HTH.
In Section
Seekers of Perl Wisdom