in reply to Re^4: Help with TK writing shorter code
in thread Help with TK writing shorter code

You could pass the slot number to the compute call:

$goSlot[$x] = $slot->Button( ... -command => sub { compute($x) },

Then, in the compute sub, you can access @sernums, @partnums, etc. e.g.:

sub compute { my( $slotnum ) = @_; print "sernum=$sernums[$slotnum], partnum=$partnums[$slotnum]\n"; }
I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.

Replies are listed 'Best First'.
Re^6: Help with TK writing shorter code
by alexanderp98 (Novice) on Sep 22, 2011 at 20:12 UTC
    Thanks, jdporter.