Perl script for running OnTape, Someone???

Perl script for running OnTape, Someone???

Post by christian_ » Sat, 19 Mar 2005 23:00:26


Hi,

Would be thankful if someone could provide me with a Perlscript for
OnTape,
or explain how to call OnTape from within Perl.

I try to solve it with a system() call, but get stuck on the question
when OnTape asks for tapedrive,,,

/Christian
 
 
 

Perl script for running OnTape, Someone???

Post by Art S. Kag » Sun, 20 Mar 2005 00:05:54


You are better off using Expect/TCL to manage an ontape session. Expect is
a rule based scripting language built over TCL which is designed for
controlling equipment and other software.

Alternatively, my ALARMPROGRAM utility manages sessions of ontape in 'C'.
It includes a response parser to read the prompts from ontape and reply.

To do this in Perl you will have to run ontape as a pipe. Read the prompts
from the read side of the pipe and reply accordingly writing to the write
side of the pipe. You'll have to handle the possibility that ontape may not
prompt you and your script will hang until the ontape completes and the pipe
closes returning an error or use the poll() or select() system calls with a
timeout. This is easier in Expect which can run the pipe asynchronously.

Art S. Kagel