Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How To: Make An Iterator

by ihb (Deacon)
on Apr 26, 2005 at 14:17 UTC ( #451582=note: print w/ replies, xml ) Need Help??


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!


Comment on Re: How To: Make An Iterator
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://451582]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2014-09-22 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (189 votes), past polls