sub _getBuilderList { my $self = shift; my $selection = shift; my $sth = $self->param('DBH')->prepare("SELECT id, buildername FROM builder ORDER BY buildername" ); $sth->execute(); my $cities; while ( my $row = $sth->fetchrow_hashref() ) { $row->{SELECTED}++ if $row->{id} == $selection; push @$cities, $row; } return $cities; } sub _getSchoolList { my $self = shift; my $selection = shift; my $sth = $self->param('DBH')->prepare("SELECT schoolname FROM school ORDER BY schoolname" ); $sth->execute(); my $cities; while ( my $row = $sth->fetchrow_hashref() ) { $row->{SELECTED}++ if $row->{schoolname} eq $selection; push @$cities, $row; } return $cities; } sub _buildGenericSelect { my ( $self, $max, $selection ) = @_; my $array; foreach my $number ( ( 1 .. $max ) ) { my $row; $row->{VALUE} = $number; $row->{SELECTED}++ if $number == $selection; push @$array, $row; } return $array; }