Re: [Golf-ish] Ordered hash keys
- From: Tad McClellan <tadmc@xxxxxxxxxxxxxx>
- Date: Fri, 29 Apr 2005 21:13:59 -0500
Damian James <djames@xxxxxxxxxxxxx> wrote:
> my @fields = @mappings[ map $_*2, 0..($#mappings/2) ];
> Is there a simpler, shorter
> or more elegant 'hashificator' that might be suitable in place of the
> arithmetic one I've shown?
You can save 3 strokes by generating the slice indexes with:
grep $_%2, 0..$#mappings
instead of map().
--
Tad McClellan SGML consulting
tadmc@xxxxxxxxxxxxxx Perl programming
Fort Worth, Texas
.
- References:
- [Golf-ish] Ordered hash keys
- From: Damian James
- [Golf-ish] Ordered hash keys
- Prev by Date: Re: [Golf-ish] Ordered hash keys
- Next by Date: FAQ 3.21 How can I compile my Perl program into byte code or C?
- Previous by thread: Re: [Golf-ish] Ordered hash keys
- Next by thread: Re: [Golf-ish] Ordered hash keys
- Index(es):
Relevant Pages
|
|