Why is this getting so much up votes.
Reasons may include:
Hash slices are syntactic sugar for iterating over a set of keys. I'd suspect the code path for both being identical (see B, do benchmarks with a meaningful set). Elegance is in the eye of the beholder.
In reply to Re^3: A more elegant way to filter a nested hash?
by shmem
in thread A more elegant way to filter a nested hash?
by jimpudar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |