package GSM::Cell; use Moose; use MooseX::AttributeHelpers; use Data::Dumper; has 'BCCH' => (is => 'rw'); has 'LAC' => (is => 'ro', required => 1); has 'CI' => (is => 'ro', required => 1); has 'NAME' => (is => 'rw', lazy => 1, default => &set_name); has 'ID' => (is => 'ro', lazy => 1, default => \&set_id); with qw(SQLConnection); ... sub BUILD { my $self = shift; my $sth = $self->dbh->prepare('select BCCHFrequency from Cell where CI = ? and LAC = ?); $sth->execute($self->CI,$self->LAC); $self->BCCH( $sth->fetchrow_array ); } ...