[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Interleaving arrays



>>>>> "eric" == eric  <raible@nextest.com> writes:
    eric> But this one is cleaner: @cats = @cats[map (($_/2 + ($_ % 2)
    eric> * ($#cats+1)/2 ), 0..$#cats)]

Or even

  @cats = @cats[map (($_/2 + ($_ % 2) * @cats/2 ), 0..$#cats)]

-- 
Stephen

"A duck!"

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe