package main; my $MW = ...; # Create your main window here. sub UNIVERSAL::MW {$MW}