#!/usr/bin/perl -w

	use strict;

	use Bio::SeqIO;

	my $seq_in = Bio::SeqIO->new (	-file => '< swiss.dat',
					-format => 'swiss');

	my $seq;
	my @seq_ary;
	while( $seq = $seq_in->next_seq() ) {
		push(@seq_ary,$seq);
	}

	@seq_ary = sort { $a->length <=> $b->length } @seq_ary;

	my $total = 0;
	my $count = 0;

	foreach my $seq ( @seq_ary ) {
		$total += $seq->length;
		$count++;
	}

	print "Shortest sequence: ", $seq_ary[0]->id, "\n";
	print "                   ", $seq_ary[0]->seq, "\n";

	print "Longest  sequence: ", $seq_ary[-1]->id, "\n";
	print "                   ", $seq_ary[-1]->seq, "\n";

	print "Mean length ",$total/$count," Median ",$seq_ary[$count/2]->length,"\n";

exit 0;

