in reply to parsing question

UPDATE:
I actually read the problem wrong, and that was answered by a lot of people by now... so ignore this unless you want to count the nucleotide amounts :)

Heres a code, that requires the user to give a filename in commandline. You should be able to use the sub within your own code as well.
#!/usr/bin/perl use warnings; use strict; my $inf=shift @ARGV || or die "Need to give a input file.\n"; open (INF,shift @ARGV); sub print_map (\$\$) { my $name_r=shift @_; my $code_r=shift @_; my %hash; print "$$name_r\n"; while ($$code_r=~m/(\w)/g) { $hash{$1}++;} foreach (sort {$a cmp $b} keys %hash) { print "$_: $hash{$_}\n"; } } my ($code,$name); while (<INF>) { chomp; if (m/^>(.+)/) { print_map ($name,$code) if ($name); $name=$1; } else { $code.=uc($_); } } print_map($name,$code); exit;