On 3/13/07, Nath, Alok (STSD) <[EMAIL PROTECTED]> wrote:
Hi,
I have a perl script which prompts user for certain inputs.
I want to automate this by creating a separate script which runs the
above perl file and probably passing the inputs in a separate text
file.
Can anybody give me some pointers or how to do this ?
snip
The open function can start a program and feed it data (like popen in C):
open my $fh, '|perl other.pl' or die $!;
open my $in, '<', 'args';
while (<$in>) {
print $fh $_;
}
If you need more control or bi-directional communication you should
use IPC::Open2 (stdin and stdout) or IPC::Open3 (stdin, stdout, and
stderr). Both are part of core Perl, so you should already have them
installed.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/