iterator
# given [1..5]
my $iterator = $array->iterator;
while (my $value = $iterator->next) {
say $value; # 1
}
The iterator method returns a code reference which can be used to iterate over the array. Each time the iterator is executed it will return the next element in the array until all elements have been seen, at which point the iterator will return an undefined value. This method returns a Data::Object::Code object.
iterator() : CodeObject
method
5 POD Errors
The following errors were encountered while parsing the POD:
- Around line 10:
Unknown directive: =name
- Around line 14:
Unknown directive: =usage
- Around line 23:
Unknown directive: =description
- Around line 31:
Unknown directive: =signature
- Around line 35:
Unknown directive: =type