#!/usr/bin/perl use strict; use warnings; use threads; use threads::shared; use Tk; my $mw=new MainWindow; $mw->title("Command Executor"); my $cmd=$mw->Entry(); $mw->Button(-text=>"Execute",-command=>\&execThread())->pack(); MainLoop; sub execThread{ my $command=$cmd->get(); my $thr=threads->create(sub{ system("$command"); })->join; }