Array::Iterator 0.06
Sponsored Links
Array::Iterator 0.06 Ranking & Summary
File size:
0.010 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
865
Date added:
2007-06-11
Publisher:
Stevan Little
Array::Iterator 0.06 description
Array::Iterator is a simple class for iterating over Perl arrays.
SYNOPSIS
use Array::Iterator;
# create an iterator with an array
my $i = Array::Iterator->new(1 .. 100);
# create an iterator with an array reference
my $i = Array::Iterator->new(@array);
# create an iterator with a hash reference
my $i = Array::Iterator->new({ __array__ => @array });
# a base iterator example
while ($i->hasNext()) {
if ($i->peek() < 50) {
# ... do something because
# the next element is over 50
}
my $current = $i->next();
# ... do something with current
}
# shortcut style
my @accumulation;
push @accumulation => { item => $iterator->next() } while $iterator->hasNext();
# C++ ish style iterator
for (my $i = Array::Iterator->new(@array); $i->hasNext(); $i->next()) {
my $current = $i->current();
# .. do something with current
}
# common perl iterator idiom
my $current;
while ($current = $i->getNext()) {
# ... do something with $current
}
This class provides a very simple iterator interface. It is is uni-directional and can only be used once. It provides no means of reverseing or reseting the iterator. It is not recommended to alter the array during iteration, however no attempt is made to enforce this (although I will if I can find an efficient means of doing so). This class only intends to provide a clear and simple means of generic iteration, nothing more (yet).
SYNOPSIS
use Array::Iterator;
# create an iterator with an array
my $i = Array::Iterator->new(1 .. 100);
# create an iterator with an array reference
my $i = Array::Iterator->new(@array);
# create an iterator with a hash reference
my $i = Array::Iterator->new({ __array__ => @array });
# a base iterator example
while ($i->hasNext()) {
if ($i->peek() < 50) {
# ... do something because
# the next element is over 50
}
my $current = $i->next();
# ... do something with current
}
# shortcut style
my @accumulation;
push @accumulation => { item => $iterator->next() } while $iterator->hasNext();
# C++ ish style iterator
for (my $i = Array::Iterator->new(@array); $i->hasNext(); $i->next()) {
my $current = $i->current();
# .. do something with current
}
# common perl iterator idiom
my $current;
while ($current = $i->getNext()) {
# ... do something with $current
}
This class provides a very simple iterator interface. It is is uni-directional and can only be used once. It provides no means of reverseing or reseting the iterator. It is not recommended to alter the array during iteration, however no attempt is made to enforce this (although I will if I can find an efficient means of doing so). This class only intends to provide a clear and simple means of generic iteration, nothing more (yet).
Array::Iterator 0.06 Screenshot
Array::Iterator 0.06 Keywords
Iterator 0.06
perl arrays
iterator
current
array
I-
class
simple
Array::Iterator
ArrayIterator
Array::Iterator 0.06
Libraries
Programming
Bookmark Array::Iterator 0.06
Array::Iterator 0.06 Copyright
WareSeeker periodically updates pricing and software information of Array::Iterator 0.06 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Array::Iterator 0.06 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
current stock price amzn
java iterator
current oil prices
array solutions
iterator java
current events
current interest rates
c++ iterator
werner array with diagrams
arrays in java
current value
current event
current gold prices
java array
current mortgage rates
iterator c++
stl iterator
arraylist java
Related Software
Iterator is a general-purpose iterator class. Free Download
Iterator::IO is a Perl module with filesystem and stream iterators. Free Download
Tiny Translator is a very simple class for easily organizing dialogue outputs and creating language tables. Free Download
Iterator::Util Perl package contains essential utilities for the Iterator class. Free Download
Iterator::Misc Perl module package contains miscellaneous iterator functions. Free Download
SPOPS::Iterator is a class to cycle through results and return SPOPS objects. Free Download
Class::DataStore is a Perl module for generic OO data storage/retrieval. Free Download
Locale::Framework is a Perl module for internationalization. Free Download
Latest Software
Popular Software
Favourite Software