jasonk's advice should handle the question at hand. On a side note, you might consider structuring your Entry widgets and their associated text variables in a hash:
my %field; my @names = (qw/serial phone email po address city state zip etc/); my @sizes = ( 30, 30, 30, 30, 75, 30, 30, 30, 80 ); my @labls = ("Serial Number:", "Phone Number:", "and so on..."); foreach (@names) { $field{$_}{txvar} = ''; $field{$_}{label} = $rf->Label(-text => shift( @labls )); $field{$_}{entry} = $rf->Entry(-width => shift( @sizes ), -textvariable => \${$field{$_}{txvar +}}, ); }
This form of array initialization can probably be improved upon -- maybe you would prefer a hash of arrays, the hash keyed by field name and each array being the label string, DB field name, textvariable scalar, and widget handle. But any sort of hash array setup will be more compact and easier to maintain/adapt that a set of discrete scalars.

(Also, note that you don't really need to keep track of the handles for those label widgets, unless you plan to recongifure them along with the Entry widgets as part of the GUI's behavior.)


In reply to Re: Tk Field Changes by graff
in thread Tk Field Changes 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.