in reply to How to set main window size in Tk

geometry does it:

$main->geometry ('500x500');

but I have to give a height as well. Can I change just the width?

Yes, by:

my $height = $main->reqheight; # or $main->height $main->geometry ('500x' . $height);
Update: supply answer

Perl is Huffman encoded by design.