use strict; use warnings; use Tk; my $sql = ""; my $mw = new MainWindow; my $top = $mw->Frame()->pack(-expand => 1, -fill => "both"); my $f1 = $top->Frame()->pack(-expand => 1, -fill => "x"); my $f2 = $top->Frame()->pack(-expand => 1, -fill => "both"); $f1->Label(-text => "SQL Statement")->pack(-side => "left"); $f1->Entry(-textvar => \$sql, -width => 64)->pack(-side => "left"); $f1->Button(-text => "SQL", -command => \&submit)->pack(-side => "right"); my $output = $mw->Text()->pack(-expand => 1, -fill => "both"); MainLoop(); sub submit { # Here, insert the code for submitting the query using $sql... my $results = ... $output->insert("end", $results); $output->see("end"); $mw->update();