This is a snippet to create a modal window (not just a Tk::Dialog or Tk::DialogBox) using Tk. I'm posting it because I couldn't find a concise way to do this anywhere, on PerlMonks, in the Tk documentation, or on the web.
When you use this code, make sure you bind your 'ok' button (or whatever you use) so that it destroy()s the window. None of the buttons normally displayed in the titlebar will be available.
$tl = $main_window->Toplevel( -title => 'Modal Dialog' );
$tl->resizable( 0, 0 );
$tl->transient($tl->Parent->toplevel);
$tl->protocol('WM_DELETE_WINDOW' => sub {});
$tl->grab;