{ ... } creates a hash initializes it with the contents of the braces, and returns a reference to the hash. It makes no sense to assign that to a hash variable.
When you use parens instead of curlies, it builds a list. When a list is assigned to a hash variable, it's treated as a sequence of key-value pairs. In the code you presented, there's only one value in the list (a reference to a hash), so it's treated as a key after issuing a warning.
That explains the problem you were already told about. You have a second problem, though.
grep($thing, @{...})
means
grep { $thing } @{...}
Since $thing has a true value, that's the same as just
@{...}
You probably want to use
grep($_ eq $thing, ...)
In reply to Re: Hash-O-Array Help
by ikegami
in thread Hash-O-Array Help
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |