in reply to change color of text box in Perl/Tk

When you declare the Checkbutton, you would want to have the handle for the text box to be in scope, so you can refer to that in a sub, to be assigned to the Checkbutton's "-command" attribute -- something like the following:
$txtbox = $textParent->Text(...)->pack(); ... $cbtnParent->Checkbutton(-variable => \$txtboxColor, -text => 'Set textbox color', -offvalue => 'gray', -onvalue => 'white', -command => sub {$txtbox->configure(-backgrou +nd => $txtboxColor)} )->pack(); # (or whatever geometry mgmt you'r +e using)