@hash{keys %hash} really is a bad idea...
What will this do? it will create a list of all the keys in the hash, use that list in a hash slice and return all values.
If you want to get all values of a hash then there is the values function... it is shorter, cleaner and more efficient.
(Another possibilty would ofcourse be to use kapproach's approach, which is probably better)
In reply to Re^2: Find the word in Array, Hash, Scalar
by Animator
in thread Find the word in Array, Hash, Scalar
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |