In think you misunderstood me. I don't want the text on the button to change but I actually have a whole hash of Entry Boxes that need to have their information updated. Second, the varname was just an example. posted below is my current code (w/o the extra subroutines to save space)
se strict; use Tk 800.00; use Mysql; require Tk::Frame; require Tk::TextUndo; require Tk::Text; require Tk::Scrollbar; require Tk::Menu; require Tk::Menubutton; require Tk::Adjuster; require Tk::DialogBox; # Main Window my $mw = new MainWindow; $mw->geometry('800x600'); # Frames Setup my $lf = $mw->Frame->pack(qw/-side left -fill y/); my $rf = $mw->Frame->pack(qw/-side right -fill y/); # Menu Bar Setup my $mb = $mw->Menu(-menuitems => &menubar_menuitems() ); $mw->configure(-menu => $mb); $mw->title("INSCO Inventory Control"); #Set Up Serial Query Information my $label_input = $lf->Label(-text=>'Serial Number: ',)->pack(qw/-si +de top/); my $tf_serial = $lf->Entry(-width=>30)->pack(qw/-side top/); my $label_space = $lf->Label(-text=>'',)->pack(qw/-side top/); my $returned = "";
Right here is where I'm working.
##Set up query button my @info; my $button_submit = $lf->Button( -text => 'Search', -command => my \@info = \&get_data )->pack(qw//); print $info[1]; #Set Up Client Information my %field; my @names = (qw/tf_po tf_client tf_contact tf_phone tf_email tf_addres +s tf_city tf_state tf_zip tf_id tf_model/); my @sizes = ( 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30); my @labls = ("PO:", "Client:", "Contact:", "Contact Phone Number:", "C +ontact Email Address:", "Contact Post Address:", "", "" , "", "Client + Specified ID", "Model"); my @pos = (1,2,3,4,5,6,7,8,9,10,11); foreach (@names) { my $position = shift(@pos); $field{$_}{txvar} = ''; $field{$_}{label} = $rf->Label( -text => shift( @labls )) ->grid(-row => '$position', -col => '0', ); $field{$_}{entry} = $rf->Entry( -width => shift( @sizes ), -textvariable => '', )->grid(-row => '$position', -col => '2', ); } # Start the main event loop MainLoop; sub get_data { my $entered = $tf_serial->get; my $dbh = Mysql->connect("host", "database", "username", "******** +") or die("Could Not Connect To Server"); my $query = qq~SELECT * FROM inventory WHERE serial='$entered'~; my $sth = $dbh->query($query); my @arr = $sth->fetchrow; return(@arr); }

In reply to Should have explained better by £okì
in thread Tk/Perl Command by £okì

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.