while ($line = <>) { $symbol{ $_ }++ for ( split //, $line ); }