#!/usr/bin/perl use warnings; use strict; use Tk; my $config; my $mw = MainWindow->new(-title=>"Demo"); $mw->withdraw; get_config($mw); MainLoop; sub setup_mw{ my $label = $mw->Label(-text=> $config)->pack(); $mw->deiconify; $mw->raise; } sub get_config { my $parent = shift; #collect your config here $config = 'hoohah'; my $win = $parent->Toplevel(-title=>'config window'); my $Bttn = $win->Button( -text=>"I'm done configuring, so press me", -command=> sub{ $win->destroy; setup_mw(); } )->pack( ); } __END__