#! /usr/bin/perl -w
use strict;
use warnings;
use Bio::SeqIO;
print "loading ... ";
my $in = Bio::SeqIO->new (-file => $ARGV[0] , '-format' => 'Fasta');
print "done\n";
while ( my $seq = $in->next_seq() ) {     
    my $filename = $seq->id().".fa";
    $filename =~ s/[\;\/]/_/g;
    print $filename," first 10 bases ",$seq->subseq(1,10),"\n";
    # output
    my $out = Bio::SeqIO->new ('-file' => ">$filename" , '-format' => 'Fasta');
    $out->write_seq($seq);
}
