swestrup has asked for the wisdom of the Perl Monks concerning the following question:
where App::Foo::DB is just a blessed hash with no methods, so that I can use it in expressions like:package App::Foo; use Moose; has 'db' => ( isa => 'App::Foo::DB' );
What I don't know, is if its possible to rewrite App::Foo::DB so as to define a type of hash that is tied to a Moose class, and if so, how one should go about it. I guess the real question is how to define a Moose class with the interface of a tied hash.$self->db->{a}{b}{c} = 'foo';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tied Hash Interface to Moose Object.
by tobyink (Canon) on Feb 21, 2013 at 20:18 UTC | |
by swestrup (Novice) on Feb 21, 2013 at 21:12 UTC |