BackPAN::Index::Role::AsHash - Role to dump object data as a hash
use BackPAN::Index::Role::AsHash; sub data_methods { return qw(list of data methods) }
A role to implement <as_hash> in result objects.
<as_hash
The receiving class must implement...
my @methods = $self->data_methods;
Returns a list of methods which get data about the object.
my $hash = $self->as_hash;
Produces a hash reference representing the object's data based on <$self-data_methods>>. Each key is a method name, the value is <$self-$method>>.
<$self-
To install BackPAN::Index, copy and paste the appropriate command in to your terminal.
cpanm
cpanm BackPAN::Index
CPAN shell
perl -MCPAN -e shell install BackPAN::Index
For more information on module installation, please visit the detailed CPAN module installation guide.