in reply to Tied Hash Interface to Moose Object.

Tie::MooseObject may be of interest to you - I'm not a fan of some of its design decisions though; I've often considered writing a replacement for it.

(In particular, if attribute "foo" has accessors get_foo and set_foo I don't want to have to do $hash{set_foo} = $x and $x = $hash{get_foo}. I expect to be able to do $hash{foo} = $x and $x = $hash{foo}.)

Update: I've finally gotten around to it.

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Replies are listed 'Best First'.
Re^2: Tied Hash Interface to Moose Object.
by swestrup (Novice) on Feb 21, 2013 at 21:12 UTC
    Yes, I had noticed Tie::MooseObject, but as it doesn't actually make a drop-in replacement for a hash, it doesn't do what I need. I suppose I might use it as a starting point to write my own if need be though.