This looks like a simple version of the FASTA format. I think that there has gotta be some bio library that can parse all possibilities of FASTA formats. I would recommend using that over my code because it will cover at least one more formatting case.
But, for your enjoyment: I posted one simple parser of the FASTA format at Re: New to Perl. Have fun!