I think you need to provide a bit more detail about the keys of your hash. As pointed out, they cannot be arrays.
Apart from that your approach seems to make sense. The something in your grep would be some condition to select some keys from your hash.
The best approach to print depends on the values of your hash. @haystack{@wants} gives you an array of the values of the selected keys. You have not told us what these values are. They could be simple numbers or complex data structures and you would need to taylor your approach to that. Data::Dumper should always give you a printout but the question is whether it is sufficient for your purpose.
In reply to Re: question about what to grep(?)
by hdb
in thread question about what to grep(?)
by crunch_this!
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |