#!/usr/bin/perl use Label::HiIAm; use Tk; create_ui(); MainLoop; exit; sub create_ui { my $win = MainWindow->new; $win->Label(-text => 'Your name')->pack; my $inp_name = $win->Entry()->pack; $win->Label(-text => 'Your organisation')->pack; my $inp_org = $win->Entry()->pack; $win->Button( -text => 'Print Label', -command => sub { Label::HiIAm::print_label( $inp_name->get, $inp_org->get, ), } )->pack; }