in reply to Moose/Mouse: assigning default to attribute on first access?

You can set lazy on foo atribute and require in default. It will be called after foo is accessed.
package MyClass; use Any::Moose; has foo => ( is => 'ro', lazy => 1, default => sub { require Foo::Heavy; Foo::Heavy->new; }, );

-- regards, Roman