in reply to take 'n' array elements at a time

What did you try? How long did it take and how much do you need to speed it up? When you profiled it, where was the slowness?

Update: in case it's not clear, the order is:

  1. write some code that does the job
  2. If it's fast enough you're done
  3. If it's too slow, profile it to figure out where a fix is needed
  4. write unit tests to make sure your speed fix doesn't break the code!

It's easy to get into a funky "do nothing" state because you can't figure out the "best" way to do something. Don't. Just pick what seems the easiest option to write and go for it. If it does the job, great. If it doesn't, at least you have something to work with and understand the problem better.

Perl is the programming world's equivalent of English