Re: seeking golfing advice
Aristotle Pagaltzis <[email protected]> Thu, 17 May 2012 12:14:59 +0200
| Newsgroups | gmane.comp.lang.perl.fun |
|---|---|
| Message-ID | <[email protected]> |
* 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 references brea= k. If you use `values` these problems go away=E2=80=A6 except that to get the o= dd- index elements from it you have to `reverse` the array, at which point a not-especially-golfed grep is shorter. --=20 *AUTOLOAD=3D*_;sub _{s/$/$"/;s/(.*):://;wantarray//substr$_,-1,1,",$/";pr= int;$1} &Just->another->Perl->hack; #Aristotle Pagaltzis // <http://plasmasturm.org/>