good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Using Expect.pm to Manage an Unreliable Programby toma (Vicar) |
on Dec 16, 2002 at 07:27 UTC ( [id://220132]=CUFP: print w/replies, xml ) | Need Help?? |
An unreliable program can be controlled from a perl program using the Expect.pm module. A description of the unreliable program and the use of the Expect module is presented.
I used this program to simulate an unreliable program.
When it succeeds, this program just prints a simple message.
When it fails, it just hangs.
I have a program that I need to run a large number of times. This program has a nasty bug in it. When you feed it bad data, it just sits there forever instead of providing a helpful error message. Bad Program! I can't change the program, but I need to call this program inside a loop in my code. So I am using the perl Expect module to skip over the problem cases and continue with the rest of the runs of the program. The Expect.pm module is capable of managing this process, so I wrote a few little test programs to help me understand how to accomplish this task.
Expect.pm Test Program One
Expect.pm Test Program Two
Expect.pm Test Program Three
Back to
Cool Uses for Perl
|
|