#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::CheckbuttonGroup; my $top = MainWindow->new(); $top->geometry('400x400'); my @selected = qw(two four); my $checkbuttongroup = $top->CheckbuttonGroup ( -font => 24, -list => [qw( one two three four five )], -orientation => 'vertical', -variable => \@selected, -command => sub { print @selected, "\n"; } )->pack(); my @selected1 = qw(8 10); my $checkbuttongroup1 = $top->CheckbuttonGroup ( -font => 24, -list => [qw( 6 7 8 9 10 )], -orientation => 'horizontal', -variable => \@selected1, -command => sub { print @selected1, "\n"; } )->pack(); MainLoop;