in reply to Re^5: Spot the bug
in thread Spot the bug
The each iterator is not unlike the behaviour of a filehandle where you are reading line by line. Perhaps you find that iterator non-obvious as well, and you prefer to do
but I bet people will comment on that if you start promoting that style on Perlmonks.my @lines = <$file_handle>; for my $line (@lines) { ... }
I find iterators bind to the data they act on far more natural than being binded to the location in the source code. It translates to an OO approach much more naturally.
Perl --((8:>*
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Spot the bug
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 Perl Mouse (Chaplain) on Dec 23, 2005 at 07:43 UTC | |
by demerphq (Chancellor) on Dec 23, 2005 at 18:18 UTC | |
Re^7: Spot the bug
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 | |
by Perl Mouse (Chaplain) on Dec 22, 2005 at 22:28 UTC | |
by shotgunefx (Parson) on Dec 22, 2005 at 23:18 UTC |
In Section
Meditations