Pcore::Util::Hash::HashArray - efficiently access hash values using pop, shift or array index.
my $hash = Pcore::Util::Hash::HashArray->new; $hash->{1} = 'v1'; $hash->{2} = 'v2'; $hash->{3} = 'v3'; say dump [ keys $hash->%* ]; say dump [ values $hash->%* ]; say $hash->[1]; say shift $hash->@*; say pop $hash->@*; say $hash->rand_key; say $hash->rand_val;
Efficiently access hash values using pop, shift or array index.
$hash->[$idx] works much faster, than standard ( values $hash->%* )[$idx].
$hash->[$idx]
( values $hash->%* )[$idx]
To install Pcore, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pcore
CPAN shell
perl -MCPAN -e shell install Pcore
For more information on module installation, please visit the detailed CPAN module installation guide.