Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks,
I have an array and its value.
@array=("one", "two", "one" "three", "four", "one", "two");
I need hash value like the below i.e. how many times words comes in array.
$hash={"one" => 3, "two" => 2, "three" => 1, "four" => 1}Can you help me how to get like that.
Thank you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Count of array value into hash
by shmem (Chancellor) on Jul 12, 2006 at 11:29 UTC | |
|
Re: Count of array value into hash
by prasadbabu (Prior) on Jul 12, 2006 at 11:17 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |