use strict; use warnings; use Tk; my $mw = MainWindow->new; $mw->title( 'Albums' ); my @Buttons; open my $FILE, "; my $NumberOfAlbums = scalar @lines; print "You have $NumberOfAlbums albums.\n"; close( $FILE ) or die "Cannot close file: $!"; my $i = 0; my @Selected; foreach my $n ( @lines ) { push( my @Values, $mw->Checkbutton( -text => "$n", -variable => \$Selected[$i], )->pack(-side => 'top', -anchor => 'nw' ) ); $i=$i+1; } my $GetAlbumsButtons = $mw->Button( -text => "Get Albums", -command => sub { print "Get Albums Button Pressed.\n"; }, )->pack( -side => 'bottom', -anchor => 's' ); MainLoop;