# note: $TOP is a global, the MainWindow sub create_screen { $TOP->destroy if $TOP; # brutish! $TOP = MainWindow->new( title => 'product' ); $TOP->optionAdd( "*tearOff", "false" ); ... etc ...