#!/usr/bin/perl use strict; use warnings; use lib qw(perllib); use Tk; use Tk::MyTest; my $mw = tkinit; $mw->Button( -command => \&test, -text => 'testen' )->pack; MainLoop; sub test{ my $diag = $mw->MyTest; my $retval = $diag->Show; warn $retval; }