in reply to Re^5: Moose Attribute Default Dependency
in thread Moose Attribute Default Dependency

I expect

my $self;

will 'initialise' $self to allow

default => $self->{Dbase}.'/come/on/now',

it to be used.

I now realise that this not OK and I must use builder.

Replies are listed 'Best First'.
Re^7: Moose Attribute Default Dependency
by elTriberium (Friar) on Nov 16, 2013 at 23:26 UTC

    You don't have to use builder, this also works:

    has 'x' => ( is => 'rw', isa => 'Str', default => sub { my ($self) = @_; return $self->value; }, lazy => 1, );
Re^7: Moose Attribute Default Dependency
by boftx (Deacon) on Nov 13, 2013 at 03:42 UTC

    By the way, I should have said this earlier, I strongly second chromatic's suggestion!

    The answer to the question "Can we do this?" is always an emphatic "Yes!" Just give me enough time and money.