Eponymous::Hash - Translates named variables to a hash list with corresponding keys
Translates named variables to a hash list with corresponding keys
use Eponymous::Hash 'epy';
The name 'epy' is arbitrary. You may define any name in the use statement.
With scalars
my $mammal = 'ponycorn'; my $diet = 'sprinkles'; my %hash = epy($mammal, $diet) # (mammal => 'ponycorn', diet => 'sprinkles')
With hash reference
my $thing = { mammal => 'ponycorns', diet => 'sprinkls' }; my %hash = epy($thing, 'mammal', 'diet'); # (mammal => 'ponycorn', diet => 'sprinkles')
With blessed object
my $thing = Thing->new; $thing->mammal; # ponycorns $thing->diet; # sprinkles my %hash = epy($thing, 'mammal', 'diet'); # (mammal => 'ponycorn', diet => 'sprinkles')
Default method name. If parameter is passed to use statement, parameter will be used instead.
0.02
Glen Hinkle tempire@cpan.org
tempire@cpan.org
To install Eponymous::Hash, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Eponymous::Hash
CPAN shell
perl -MCPAN -e shell install Eponymous::Hash
For more information on module installation, please visit the detailed CPAN module installation guide.