$retval = fork(); if ($retval == -1) {    die "fork() failed: $!\n"; } elsif ($retval == 0) {    exec("$find / -type f > tmp.txt 2>&1") || die "Error\n"; } else {     while(!waitpid ($retval, WNOHANG)) {     if ( $percent_done == 150) { $percent_done=0 } else { $percent_done++; $toplw->update(); sleep 1; }     } }