Object::FromData::Array - Create an object from an arrayref.
Don't instantiate directly using this module. Use Object::FromData instead.
Object::FromData
my $arrayref = Object::FromData->new( { ref => \@array } ); while ( $arrayref->has_more ) { my $value = $arrayref->next; ... }
has_more
while ( $arrayref->has_more ) { my $value = $arrayref->next; ... }
Boolean indicating if the array iterator is exhausted.
next
my $value = $arrayref->next;
Returns the next value in the arrayref iterator.
reset
$arrayref->reset;
Resets the arrayref iterator.
all
my @values = $arrayref->all;
Returns a list of all values. Each value might be an Object::FromData:: object if it's a reference.
Object::FromData::
num_elems
my $num_elems = $arrayref->num_elems;
Returns the number of elements in the array reference.
current_index
my $i = $arrayref->current_index;
Returns the current numeric index of the iterator.
is_hashref
if ( $arrayref->is_hashref ) { ... }
Returns false.
is_arrayref
if ( $arrayref->is_arrayref ) { ... }
Returns true.
To install Object::FromData, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Object::FromData
CPAN shell
perl -MCPAN -e shell install Object::FromData
For more information on module installation, please visit the detailed CPAN module installation guide.