in reply to Style and Preference on Loops

The first style, the C style counting loop, requires that you maintain your own iterator ($i), ensure it is always incremented, and check the bounds of the array. With the second loop, perl does all that for you.

I expect the second is more efficient, although I have never measured it and I doubt the difference is huge, but I prefer the second because of two principles:

1. Less code generally means fewer bugs.
2. Why have a dog and bark yourself?