perl and DOS I/O

H

Hemant Kumar

Hi,
I need to run a n iterations of a dos program from perl. I am using
System ("program args");

There are two interactions with DOS that I need to take care of though

1) The program spews output that goes to the DOS window. Is there a
way to absorb it and process it from perl script?

2) Once the program reaches a certain point in execution, it requires
an input from the keyboard to move ahead. How can I issue this input
from the perl script.

Thank you for giving this a thought.
Hemant
 
N

nobull

Hi,
I need to run a n iterations of a dos program from perl. I am using
System ("program args");

There are two interactions with DOS that I need to take care of though

1) The program spews output that goes to the DOS window. Is there a
was to absorb it and process it from perl script?

This is a FAQ: "Why can't I get the output of a command with
system()?"

It is also answered in the documentation of system() function.
2) Once the program reaches a certain point in execution, it requires
an input from the keyboard to move ahead. How can I issue this input
from the perl script.

This is covered in other FAQs: "How can I write expect in Perl?" but I
don't know how well it works on Rendmondware.

However you may do better to figure out how to prevent it pausing like
this - maybe there are some command line switches. Maybe it can be
made to read from a file instead.

This newgroup does not exist (see FAQ: "What are the Perl newsgroups
on Usenet?"). Please do no start threads here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top