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:>*
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Spot the bug
by tlm (Prior) on Dec 21, 2005 at 16:51 UTC | |
by Perl Mouse (Chaplain) on Dec 21, 2005 at 17:46 UTC | |
by demerphq (Chancellor) on Dec 22, 2005 at 09:12 UTC | |
by Perl Mouse (Chaplain) on Dec 22, 2005 at 11:48 UTC | |
by eric256 (Parson) on Dec 23, 2005 at 04:25 UTC | |
| |
by shotgunefx (Parson) on Dec 21, 2005 at 19:04 UTC | |
by Perl Mouse (Chaplain) on Dec 22, 2005 at 01:50 UTC | |
by shotgunefx (Parson) on Dec 22, 2005 at 12:12 UTC | |
|
In Section
Meditations