#!/usr/bin/perl # AnmeldeFenster.pl  use strict;  use warnings;  use Tk;  my $mw = MainWindow->new();  $mw->withdraw();  $mw->Label(-text => "You're successful logged in!")->pack();  my $tp_login = $mw->Toplevel();  $tp_login->title('Login');  my $l_msg = $tp_login->Label(-foreground => 'black')->grid('-');  my $l_login = $tp_login->Label(-text => 'Login:');  my $e_login = $tp_login->Entry();  $l_login->grid($e_login);  my $l_passwd = $tp_login->Label(-text => 'Password:');  my $e_passwd = $tp_login->Entry(-show => '*');  $l_passwd->grid($e_passwd);  my $b_login = $tp_login->Button(-text => 'Login',                                  -command => \&login);  my $b_cancel = $tp_login->Button(-text => 'Cancel',                                   -command => \&exit_app);  $b_login->grid($b_cancel);  $tp_login->grab();  $tp_login->focus();  MainLoop;  sub login {      my $login =  $e_login->get();      my $passwd = $e_passwd->get();      if( $login eq 'admin' and $passwd eq 'secret') {          $tp_login->grabRelease();          $tp_login->destroy();          $mw->deiconify();          $mw->raise();      }      else {          $l_msg->configure(-text => 'Invalid login');          $e_login->configure(-text => '');          $e_passwd->configure(-text => '');      }  }  sub exit_app { Tk::exit; }