in reply to Re^2: Tk::DialogBox as the top window
in thread Tk::DialogBox as the top window

the DialogBox actually poped up, but it is not the top window

Usually, a

$window->raise;
raises your window, but in the case of a dialog, you might need to do something like:
$mw->after(50, sub {$dialog->raise}); $dialog->Show;
to schedule a callback to be executed after the dialog is shown. Untested :)

Also, if you don't need your MainWindow, why don't you withdraw it?