for $i ( @array ) { $buttonhash{$i} = $mw->Button( -text => "Button $i", -command => [\&printme, $i], )->pack(); } #### $buttonhash{$i}{'object'} = $mw->Button(....) #### $buttonhash{$i}{'button_text'} = 'foobar'
## $buttonhash{$i}{'object'} = $mw->Button(....) ##
## $buttonhash{$i}{'button_text'} = 'foobar'