this_thing.pl #!/usr/bin/env perl use strict; use warnings; use utf8; use Tk; my $mw = MainWindow->new; my $button = $mw->Button( -text => 'start other thing', -command => \&start, )->pack; my $text = $mw->Text()->pack; MainLoop; sub start { my $script_path = 'this_other_thing.pl'; if (not my $read = do $script_path) { warn "couldn't parse $script_path: $@" if $@; warn "couldn't do $script_path: $!" unless defined $read; warn "couldn't run $script_path" unless $read; } } this_other_thing.pl #!/usr/bin/env perl use strict; use warnings; use utf8; print "Hello World!\n";