sub doUserPageUi { my ($pg, $dbh) = @_; my @listnames; $pg->Label(-text => 'Username', -justify => 'right', -width => '20') ->grid(my $user_list = $p1->BrowseEntry(-variable => \$state->{srcUname}, -browsecmd => \&doUserSearch, -width => '20'), -sticky => 'w', -pady => '20'); $pg->Label(-text => 'First Name', -justify => 'right', -width => '20') ->grid($p1->LabEntry(-textvariable => \$user->{firstname}, -width => '20'), -sticky => 'w', -pady => '5'); $pg->Label(-text => 'Last Name', -justify => 'right', -width => '20') ->grid($p1->LabEntry(-textvariable => \$user->{lastname}, -width => '20'), -sticky => 'w', -pady => '5'); $pg->Label(-text => 'Password', -justify => 'right', -width => '20') ->grid($p1->LabEntry(-textvariable => \$user->{password}, -width => '20'), -sticky => 'w', -pady => '5'); $pg->Button(-text => 'Save/Update', -command => \&doUserUpdate)->grid(-columnspan => '2', -pady => '30'); my $SQL = "SELECT username FROM user;"; debug("SQL = $SQL"); my $sth = $dbh->prepare( $SQL ) or die $DBI::errstr; my $exec = $sth->execute; debug("Prepare result: $exec"); while ( my ($username) = $sth->fetchrow_array() ) { push @listnames, $username; debug("Username: $username"); } $sth->finish; debug("@listnames"); $user_list->insert('end', @listnames); return; }