From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more
1234567891011 #!/usr/local/bin/perl -wuse strict;use Tk;use Tk::widgets qw(Button);#use Carp ();#$SIG{'__DIE__'} = \&Carp::confess;my $mw = MainWindow->new();$mw->Button(-text => 'Quit', -command => [destroy => $mw])->pack;$mw->Button(-text => 'Exit', -command => sub { exit } )->pack;MainLoop;
#!/usr/local/bin/perl -w
use
strict;
Tk;
Tk::widgets
qw(Button)
;
#use Carp ();
#$SIG{'__DIE__'} = \&Carp::confess;
my
$mw
= MainWindow->new();
->Button(
-text
=>
'Quit'
,
-command
=> [
destroy
])->
pack
'Exit'
sub
{
exit
} )->
MainLoop;