use warnings; use strict; use Tk; use Tk::Button; use Tk::Checkbutton; use Tk::LabEntry; use Tk::Label; my $cmdLineText; my $mw=MainWindow->new(-title=>'Foo Installer'); my $row = 0; my $w_install = $mw-> Button ( -overrelief=>'raised', -relief=>'raised', -text=>'Install', -command=>\&installItems) -> grid(-column=>0, -row=>++$row, -columnspan=>3, -sticky=>'nsew'); my $w_cmdWindow = $mw->Label (-height=>7, -foreground=>'white', -background=>'black', -textvariable => \$cmdLineText)->grid(-column=>0, -row=>++$row, -columnspan=>3, -rowspan=>10, -sticky=>'nsew'); MainLoop; sub installItems { open (FILE, "cmd.exe /c dir|"); #does something $cmdLineText = ""; while () { #chomp; $cmdLineText .= $_; } close(FILE); }