http://qs1969.pair.com?node_id=763765

Angharad has asked for the wisdom of the Perl Monks concerning the following question:

I have a file that looks like this
>SEQ1 -----I--RL--AAIDVDG-NLT----------D--R--D-RL-ISTKA-IESIRS--A- -E-K--------K-GLT-VSL----LS------GN-V----I-PVV---YA-L------K IF---------------L-----GINGPVF------------------------------ >SEQ2 -MKI----KA--ISIDIDG-TIT------YPN-R-------MIHEK--A-LEAIRR--A- -E-S--------L-GIP-IML----VT------GN-T----V-QFA---EA-A------S IL---------------I-----G----TS-----------------GP-VV-------- >SEQ3 --KI----KA--ISIDIDG-TIT------YPN-R-------MIHEK--A-LEAIRR--A- -E-S--------L-GIP-IML----VT------GN-T----V-QFA---EA-A------S IL---------------I-----G----TS-----------------GP-VV-------- ---AE--D------GG---A---------------------------------------I
The lines starting with '>' are the headers and the series of letters and dashes underneath each header is the 'sequence' associated with that header. I would like to split this data so that the header is one element in the array and the sequence data underneath is in another so - for example
element[0] = >SEQ1 element[1] = -----I--RL--AAIDVDG-NLT----------D--R--D-RL-ISTKA-IESIRS- +-A- -E-K--------K-GLT-VSL----LS------GN-V----I-PVV---YA-L------K IF---------------L-----GINGPVF------------------------------
On first sight, it seems a fairly easy split operation, and I thought initially I could just split on new line, but I cant due to the sequence data occurring over several lines in the file. Any advise/thoughts on how I might be able to do this much appreciated. Thanks in advance.