++ed by:
EGOR

1 PAUSE user(s)
1 non-PAUSE user(s).

Glen Hinkle

NAME

Eponymous::Hash - Translates named variables to a hash list with corresponding keys

DESCRIPTION

Translates named variables to a hash list with corresponding keys

USAGE

  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')

METHODS

eponymous_hash

Default method name. If parameter is passed to use statement, parameter will be used instead.

VERSION

0.02

AUTHOR

Glen Hinkle tempire@cpan.org




Hosting generously
sponsored by Bytemark