in reply to Count values in a hash
use strict; use warnings; my %hash=( 'A2M' => [ 'C972Y', 'A423W' ], 'A4GALT' => [ 'W261X', 'P251L', 'P251S', 'A219V' ] ); print map { my $count=0; my $x=0; map { $count++;$x++ if /X/ } @{$hash{$_}}; join "\t",$_,$count,$x,"\n"; } keys %hash;
|
|---|