use Tk;

$window = MainWindow->new;

@want = ("Name","Service No.","Course");
foreach my $question(@want) {
$lhs = $window->Label(-text => $question);
$d{$question} = "";
$rhs = $window->Entry(-textvariable => \$d{$question});
$lhs -> grid($rhs);
}

$confirm = "";

# Note - button state disabled and normal to flip back and
# forth between it being greyed out and active. A much better
# approach than having it appear and disappear

$done = $window->Button(-text => "Done", -command => \&review);
$echo = $window->Label(-textvariable => \$confirm);
$rusure = $window->Button(-text => "RUSure", -command => \&final,
-state => "disabled");

$done -> grid("-");
$echo -> grid("-");
$rusure -> grid("-");

MainLoop;

sub review {
$confirm = "";
foreach $el (@want) {
$confirm .= "$el ... $d{$el}\n";
}
$rusure->configure(-state => "normal");
}

sub final {
open (FH,">>logger");
print FH $confirm;
close FH;
exit;
}

__END__