#!/usr/bin/perl -w use Tk; use warnings; use diagnostics; use strict; my $text; my $mw = MainWindow->new; $mw->title("PerlRun"); $text = $mw->Text(-height => 1, -width => 15)->pack(-anchor => 'nw', -side => 'top'); $mw->Button(-text => " Run ", -command => [ \&runprog ]) ->pack(-side => 'left', -anchor => 'sw'); $mw->Button(-text => "Done", -command => sub { exit }) ->pack(-side => 'left', -anchor => 'sw'); sub runprog { system "\$text"; exit; } MainLoop;