my $string=qq(> abcd1234 abcd abcd >xyz123 xyz); $string =~s/[\s\n]+//g; #squash out the whitespace and newlines my @f=split(/[\>]/,$string; # CAVEAT: just wrote the off the top of my head...