in reply to Tk::JComboBox -choices option

I'm not sure why you're using the string "Undef" instead of an actual undef, maybe that could be changed wherever you are generating %TableHeaders? Anyway, given what you've showed, here's a suggestion, this does an lc so the casing of "Undef" shouldn't matter:

-choices => [ map { { -name=>$TableHeaders{$_}, -value=>$_ } } grep { length $TableHeaders{$_} && lc($TableHeaders{$_}) ne 'undef' } sort keys %TableHeaders ],

If the keys of %TableHeaders are always numbers, you should do ... sort {$a<=>$b} keys ... instead.

Replies are listed 'Best First'.
Re^2: Tk::JComboBox -choices option
by Anonymous Monk on Jun 11, 2017 at 19:10 UTC

    brilliant, thank you!