http://qs321.pair.com?node_id=244634

ok has asked for the wisdom of the Perl Monks concerning the following question:

Monks of honor: I've come to realize that Tk does have some limitations that I need to know how to get around. I have a button that leads to a command:
my $button_submit = $lf->Button( -text => 'Search', -command => \&get_data )->pack(qw//);


This works perfectly to build a button but once I'm in the subroutine, I no longer can use the Tk command configure to update other fields. This is necessary. My program works so that it takes the information from a field when you click the button, searches a database for a match and returns the matching row. (to make a long story short)

What I really need to do is find out some way to use the configure command for Tk inside that subroutine or know how to make a button in which I can save a varriable (like below but note: this does not work.
my @info; my $button_submit = $lf->Button( -text => 'Search', -command => \@info = \&get_data )->pack(qw//);


In case anyone is wondering, below is posted the error I get when I try to run the command. (inside the subroutine)
$varname->configure(-textvariable => 'helloo');


The Error Message:
Tk::Error: Can't call method "configure" on an undefined value at disp +atch.pl li ne 158. [\&main::__ANON__] Tk callback for .frame.button Tk::__ANON__ at C:/Perl/site/lib/Tk.pm line 228 Tk::Button::butUp at C:/Perl/site/lib/Tk/Button.pm line 111 (command bound to event)