Hmmm, start by using the attribute methods instead of the attribute elements as I mentioned earlier. On a side note, we need to get you more tools than just a hammer so everything doesn't look like a nail. :)

A double-dependency as you put it is fine, but if you are not using the attribute methods you might well lose the ability to have it work as expected. Again, use $self->Dbase and not $self->{Dbase} (and similarly for Dbin and Ddata.) Start with that change and see what happens. Oh, one more thing I just noticed: you need to use the "lazy" property to take full advantage of a deferred build in the proper sequence.

And maybe consider just what should be an attribute and what can be handled by a simple method call. I'm sure there are those here who would think that much of what you are doing can be done with just a very few attributes and the rest being methods, assuming that you really expect to default most (all?) of the derived directory names from Dbase and not provide values in the constructor. For example:

# instead of this (which should have "lazy" set as well): has 'Dbin' => ( is => 'rw', isa => 'Str', builder => '_build_Dbin', predicate => 'has_Dbin' ); sub _build_Dbin { my $self = shift; return $self->{Dbase}.'/apps/combinetools/combineprocessing'; } # consider this instead if you will never set the value of Dbin # in the constructor. Note the use of $self->Dbase and not $self->{Dba +se}. sub Dbin { my $self = shift; return $self->Dbase.'/apps/combinetools/combineprocessing'; }
The answer to the question "Can we do this?" is always an emphatic "Yes!" Just give me enough time and money.

In reply to Re^7: Moose Attribute Default Dependency by boftx
in thread Moose Attribute Default Dependency by dpath2o

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.