I'm not sure you can do it from Perl after the DOS exe starts.  You can
do it when you first start the program with piping or redirection if the
program uses STDIN.  If there is only one line of input required use
system("echo John Doe | prog.exe").  If, for example, you need to enter
name, age and favorite color use redirection from a file.

The Perl script can create prog_input.txt containing:
John Doe
25
red

Then use system("prog.exe < prog_input.txt").

This won't work of the program uses console IO.  Not pure Perl but it
may do what you want.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 07, 2001 12:12 PM
To: [EMAIL PROTECTED]
Subject: Getting Perl to fill in requested data for a dos program




Hi,

I'm trying to get perl to give input to a dos program.  Here's a
description of
what I want it to do:

1. I want to have perl kick off a dos program that doesn't accept
command line
parameters.
2. The Dos program, that perl will have started, will then prompt the
user for
input like "Enter Name:"
3.  I want Perl to fill in what the program is asking for on the screen,
and
then send a carriage return.

Any ideas?

Thanks in advance,
Jeff


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users


Reply via email to