home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spezial / SPEZIAL2_97.zip / SPEZIAL2_97.iso / ANWEND / EDITOR / NVI179B / NVI179B.ZIP / perl_scripts / tk.pl < prev    next >
Text File  |  1996-07-02  |  432b  |  21 lines

  1. # make sure every subprocess has it's exit and that the main one
  2. # hasn't
  3. sub fun {
  4.     unless ($pid = fork) {
  5.         unless (fork) {
  6.             use Tk;
  7.             $MW = MainWindow->new;
  8.             $hello = $MW->Button(
  9.                 -text    => 'Hello, world',
  10.                 -command => sub {exit;},
  11.             );
  12.             $hello->pack;
  13.             MainLoop;
  14.         }
  15.         exit 0;
  16.     }
  17.     waitpid($pid, 0);
  18. }
  19.  
  20. 1;
  21.