#!/usr/bin/perl 
#use warnings;
#use strict;
use Bio::AlignIO;

my $usage = "clustalw2multifasta.pl infile outfile\n";

my $infile  = shift or die $usage;
my $outfile = shift or die $usage;

my $in  = Bio::AlignIO->new(-file => $infile     , '-format' => 'clustalw');
my $out = Bio::AlignIO->new(-file => ">$outfile" , '-format' => 'fasta');

# note: we quote -format to keep older perl's from complaining.
while ( my $aln = $in->next_aln() ) {
    $out->write_aln($aln);
}
