in reply to Re^2: Creating variables for each array member
in thread Creating variables for each array member
So for instance in
for $i ( @array ) { $buttonhash{$i} = $mw->Button( -text => "Button $i", -command => [\&printme, $i], )->pack(); }
It would be better to write it as
that way, you can stuff the hash with other data, like$buttonhash{$i}{'object'} = $mw->Button(....)
$buttonhash{$i}{'button_text'} = 'foobar'
|
|---|