http://www.perlmonks.org?node_id=1007829


in reply to What is wrong in this code???

use strict; use warnings; my @gene; while (<>) { my $i = 0; for my $char ( split '', (split)[1] ) { $gene[$i++]{$char}++; } } my $i = 0; for my $pos (@gene){ print "\nPOS: ", $i++; for my $key ( sort keys %$pos){ print " | $key => ", $pos->{$key}; } };