Key/Value Hash Slices were added in Perl v5.20 (the rest of the Slices doc is probably worth a read too).
Thanks for mentioning that here; as to my knowledge that is the first time it has been.
It had gone completely under my radar; and -- along with the index/value array slices -- looks to be a really useful addition.
IMO that is probably the most useful addition since they added defined-OR back in 5.10.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |
| [reply] [d/l] |
Thanks haukex, appreciate the links to the perldata doc. I usually can only get where I need to be in the docs via a Google search. Everything I know about slices I picked up from the last chapter of "Learning Perl 6th Edition", which only briefly points out that it can be done on arrays and hashes and the basics of how to do it. I'm pretty sure that's where I picked up the @gimme_this_slice_of_values{ @for_this_list_of_keys } trick. It's not like they could dive too deep in to usage on more complex data structures that would require dereferencing, and since they wrote that book under Perl 5.14 the Key/Value Hash Slice variation wasn't covered.
I love it when things get difficult; after all, difficult pays the mortgage. - Dr. Keith Whites
I hate it when things get difficult, so I'll just sell my house and rent cheap instead. - perldigious
| [reply] [d/l] |