#!/usr/bin/perl -w
# -*-Perl-*-
# Last changed Time-stamp: <2008-06-16 13:54:37 ivo>

my $open = 0;
while(<>) {
    chomp;
    if (/^> *(\S+)/) {
	if ($open) {
	    print OUT "\n";
	    close(OUT);
	}
	$open=1;
	open(OUT, ">$1.seq");
	print OUT "$_\n";
    }
    else {
	print OUT;
    }
}
