in reply to On Foreach Loops and Maintainability
Consider, however, a case where there are hundreds or even thousands of argNs - in that case, it's clearly easier to read and maintain a foreach ( 0 .. 1000 ) than a qw// containing a huge number of words. (This isn't so rare - consider iterating through a fixed portion of a client database, for example).
I think both approaches have their relative pros and cons - and it's a case of choosing whichever is most suitable for the code being written, taking readability and maintenance into account at design-time. After all, most Perl programmers would be able to quickly understand either syntax, especially if it's familiar code or territory.
Just some quick thoughts...
--Foxcub
|
|---|