#!/usr/bin/perl -- use strict; use warnings; use Tk; use Tk::Wizard; Main(@ARGV); exit(0); sub Main { @_ ? T160() : PM899927(); } #~ http://perlmonks.org/?node_id=899927 #~ Confused by variable scope in Tk::Wizard sub PM899927 { my $wiz = new Tk::Wizard( -title => "Kickstart Wizard" ); my $oschoice = 'test'; $wiz->addSingleChoicePage( -text => 'Choose OS', -variable => \$oschoice, -choices => [ { -title => 'Linux', -value => 'Lin' }, { -title => 'Windows', -value => 'Win', -selected => 1, }, ], -preNextButtonAction => sub { warn "\$oschoice $oschoice "; }, ); $wiz->addPage( sub { #~ shift->_text_frame( $wiz->_text_frame( { -title => 'Partitioning', -boxedtext => \"/mirror/inifiles/partition.$oschoice", } ); }, ); $wiz->Show; $wiz->focus; MainLoop; } ## end sub PM899927