in reply to Re^5: how to let sub return hash of 2 sub?
in thread how to let sub return hash of 2 sub?
over{ package NameValTuple; use Moose; has name => ( is => 'rw' ); has val => ( is => 'rw' ); no Moose; __PACKAGE__->meta->make_immutable; }
{ package NameValTuple; sub new { my $class = shift; bless({ @_ }, $class) } sub name { $_[0]->{name} } sub val { $_[0]->{val} } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: how to let sub return hash of 2 sub?
by Anonymous Monk on May 30, 2015 at 21:15 UTC |