Re: seeking golfing advice
Steve Fink <[email protected]> Thu, 17 May 2012 12:35:41 -0700
| Newsgroups | gmane.comp.lang.perl.fun |
|---|---|
| Message-ID | <CA+80VKhiVyBQiGR4qowRkUW3f4UnhFLqW06huwCBVVysutBq2Q@mail.gmail.com> |
On Thu, May 17, 2012 at 3:14 AM, Aristotle Pagaltzis <[email protected]> wro= te: > * Mike Erickson <[email protected]> [2012-05-16 15:45]: >> If you don't care about order, but just want those elements, you can >> also do: >> >> keys%{{@a}} > > There is more than order that gets lost. If you use `keys` you also get > everything back stringified =96 undefs are lost and references break. If > you use `values` these problems go away=85 except that to get the odd- > index elements from it you have to `reverse` the array, at which point > a not-especially-golfed grep is shorter. So you'd want values%{{1,@a}} then