Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: How To: Make An Iterator

by ihb (Deacon)
on Apr 26, 2005 at 14:17 UTC ( [id://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!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-16 23:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found