#!/win2k/Perl/bin/perl use warnings; use strict; use Tk; use Tk::Checkbutton; use Tk::Radiobutton; our $var1 = 1; our $var2 = 1; my $mw = Tk::MainWindow->new(); my ($check1, $check2); $check1 = $mw->Checkbutton( -text => 'Check 1', -onvalue => 1, # -offvalue => 2, # Update: Don't need this -variable => \$var1, )->pack(); $check2 = $mw->Checkbutton( -text => 'Check 2', -onvalue => 2, # -offvalue => 1, # Update: Don't need this -variable => \$var1, )->pack(); # Or use a radio button... my ($radio1, $radio2); $radio1 = $mw->Radiobutton( -text => 'Radio 1', -value => 1, -variable => \$var2, )->pack(); $radio2 = $mw->Radiobutton( -text => 'Radio 2', -value => 2, -variable => \$var2, )->pack(); MainLoop; print "Var1: $var1\nVar2: $var2\n";