in reply to Tk Field Changes

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.)

Replies are listed 'Best First'.
wonderful
by £okì (Scribe) on Mar 20, 2003 at 15:23 UTC
    Thanks guys that helped a lot. I like the hash idea, glad you thought of it. Makes everything a lot neater.