my $mw = new MainWindow; my $frame = $mw->Frame(); # do something with the frame $frame->pack(-side => 'left');