Data::Transpose::Iterator::Scalar - Scalar iterator for Data::Transpose.
This iterator extends Data::Transpose::Iterator::Base, but as argument to the constructor accepts a arrayref with scalar values.
Internally, the records are kept and returned as hashrefs. You can set the key of the hashrefs with with the key method.
key
my $iter = Data::Transpose::Iterator::Scalar->new([1, 2, 3, 4, 5]); $iter->next; # return { value => 1 }; $iter->key('string'); $iter->next; # return { string => 2 };
Internally, the records are kept and returned as hashrefs. This accessor controls then name of the key.
To install Data::Transpose, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Transpose
CPAN shell
perl -MCPAN -e shell install Data::Transpose
For more information on module installation, please visit the detailed CPAN module installation guide.