Sponsoring The Perl Toolchain Summit 2025: Help make this important event another success Learn more
123456789101112 #!/usr/local/bin/perl -wuse strict;use Tk;use Tk::widgets qw(Button);#use Carp ();#$SIG{'__DIE__'} = \&Carp::confess;my $mw = MainWindow->new();my $text = "This is 2¢ worth of text";$mw->Entry(-textvariable => \$text, -width => 20)->pack;$mw->Button(-text => 'Quit', -command => [destroy => $mw])->pack;MainLoop;
#!/usr/local/bin/perl -w
use
strict;
Tk;
Tk::widgets
qw(Button)
;
#use Carp ();
#$SIG{'__DIE__'} = \&Carp::confess;
my
$mw
= MainWindow->new();
$text
=
"This is 2¢ worth of text"
->Entry(
-textvariable
=> \
,
-width
=> 20)->
pack
->Button(
-text
=>
'Quit'
-command
=> [
destroy
])->
MainLoop;