Help for this page

Select Code to Download


  1. or download this
    # unreliable.pl - Simulate a program that sometimes just hangs
    if (rand(10) > 8){
    ...
            "It worked this time, no problems\n",
            "--------------------------------\n";
    }
    
  2. or download this
    # timeout.pl - Expect Test Program
    use Expect;
    ...
        or die "Cannot spawn unreliable process $!\n";
      $exp->expect($timeout);
    }
    
  3. or download this
    use Expect;
    my $timeout=5;
    ...
        ]
      );
    }
    
  4. or download this
    use Expect;
    
    ...
      print "Status: $spawn_ok\n";
    }