my @header = (); for(my $c = 0; $c < $rangecolumns; $c++) { my @row = (); if ($_[2]->headerCget($c, -itemtype) && $_[2]->headerCget($c, -itemtype) eq 'text') { my %entry = ( $_[2]->headerCget($c, -text) => 40); push @row, \%entry; } push @header, \@row; } my $desc = { columns => { data => @header, }, };