#!/usr/local/bin/perl -w use strict; use Tk; $mw = MainWindow->new; my $test_button = $mw->Button(-text => "print test",-command=> sub { print "test\n"; } )->pack(); MainLoop;