my $shiftselect; my $shiftsframe = $topframe->Frame->pack; &displayshifts; sub displayshifts { ## Display all shift types and create Radiobuttons for each my ($ra, $rb); while (($ra, $rb) = each (%db_sh)) { $_ = $topframe->Radiobutton(-text => $db_sh{$ra}->{'ShiftName'}, -variable => \$shiftselect, -value => $ra ) -> pack; } }