... for (my $i = 0; $i <= $#$rrecent; $i++) { $$rbut[$i] = $bpanelframe->Button( -text => $$rrecent[$i], -fg => $clrfgbut, -activeforeground => $clrfgbut, -command => [\&fire, $$rrecent[$i], $_[0]] ) ->pack( -side => 'top', -anchor => 'n', -fill => 'x', -expand => 1 );} } ... $bpanelframe->pack( -side => 'top', -anchor => 'n', -fill => 'both', -expand => 1 );