http://qs321.pair.com?node_id=518339


in reply to Re^3: Spot the bug
in thread Spot the bug

The problem is people have a bad habit of forgetting to reset the iterator,
Yes, and? As long as you don't forget it in your general routine (unless you have good reason not to).
heaven help you if the general routine calls back out to uncontrolled code from inside the loop.
Yes, and? Presumably the uncontrolled code was passing in as an argument, one way or the other (otherwise, it wouldn't be uncontrolled). It's the users responsibility, just as it's the users responsibility to not pass in vital files as arguments to unlink.

Iterators hand the programmer some rope, but what doesn't? That's not a reason to avoid iterators all together.

Perl --((8:>*