Re: seeking golfing advice
Aristotle Pagaltzis <[email protected]> Fri, 18 May 2012 11:29:19 +0200
| Newsgroups | gmane.comp.lang.perl.fun |
|---|---|
| Message-ID | <[email protected]> |
* Steve Fink <[email protected]> [2012-05-18 10:25]: > On Thu, May 17, 2012 at 3:14 AM, Aristotle Pagaltzis <[email protected]>= wrote: > > * 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 =E2=80=93 undefs are lost and referen= ces > > break. If you use `values` these problems go away=E2=80=A6 except tha= t 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 D=E2=80=99oh!