in reply to How To: Make An Iterator
&infinite_evens is unnecessary complicated.
sub infinite_evens { my ($i) = @_; $i += $i % 2 - 2; return sub { $i += 2 }; }
ihb
See perltoc if you don't know which perldoc to read!
|
---|
In Section
Tutorials
in reply to How To: Make An Iterator
&infinite_evens is unnecessary complicated.
sub infinite_evens { my ($i) = @_; $i += $i % 2 - 2; return sub { $i += 2 }; }
ihb
See perltoc if you don't know which perldoc to read!
|
---|