http://www.perlmonks.org?node_id=929947


in reply to Getting the last line

try this
my $sequence_to_parse =">test\nATG\nGGG"; while ($sequence_to_parse=~/^>.*\n(^(?!>).*\n.*$)+/gm) {print "$&\n";}