in reply to Moose, Class::DBI, and builder

Yes, it should be built when the method is called. You are accessing the attribute element directly instead of calling the method on the object.

print "\$obj->{'manual_pnone'} " . $obj->{'manual_phone'} . "\n"; # wr +ong # as opposed to print "\$obj->manual_pnone " . $obj->manual_phone . "\n"; # correct
Which ultimately fails because of the same mistake here:
sub _build_manual_phone { my $self = shift; if (! defined $self->{merch_info}) { die "ERROR: merch_info not defined\n"; } return $self->{merch_info}->MANUAL_NUMBER; }
Always use accessors unless you are in the package that defines the element. (And many would argue you should do so even there.)

Update: I would also double check the case of the column names. Are they really being stored in "merch_info" as upper case?

You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

Replies are listed 'Best First'.
Re^2: Moose, Class::DBI, and builder
by perldiverx (Beadle) on Jul 10, 2014 at 19:36 UTC
    Thanks, that got it! I must have misunderstood the Moose docs. As for the column names, yes, they are stored in all caps. I didn't create the DB though, just working with it.