Perl will happily increment an undefined variable. In other words, the block above does exactly the same as justif ($charCount{$char}){ $charCount{$char}++; }else { $charCount{$char}=1; }
$charCount{$char}++;
In reply to Re: Hash to count characters
by FunkyMonk
in thread Hash to count characters
by amittleider
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |