A
Alex Lee
Dear all: I am having a problem that is driving me nuts and I hope some
one can help me.
Basically I need to access another program/script from my perl script.
This is easy. It is not when the program ask for an input (ie yes or
no).
here is an example:
------------------------------------
-- external script
$|=1;
print "enter something \n";
my $i = <>;
print "your input: $i";
-------------------------------------
-- my script:
open(TE, "perl externalScript.pl|") or die "no";
while(<TE>){
print "$_";
### need to print "hello world \n\r" when $_ =~ /enter/;
}
---------------------------------------
basically I need the external program to accept my input:
example: print "hello world \n\r" when $_ =~ /enter/;
I tried many different ways, but none works so far. I figure that is
probablt has something to do with redirecting my STDOUT from my script
to the external program. How I do not know. If anyone can help, it
would be greatly apprecaited.
thanks.
one can help me.
Basically I need to access another program/script from my perl script.
This is easy. It is not when the program ask for an input (ie yes or
no).
here is an example:
------------------------------------
-- external script
$|=1;
print "enter something \n";
my $i = <>;
print "your input: $i";
-------------------------------------
-- my script:
open(TE, "perl externalScript.pl|") or die "no";
while(<TE>){
print "$_";
### need to print "hello world \n\r" when $_ =~ /enter/;
}
---------------------------------------
basically I need the external program to accept my input:
example: print "hello world \n\r" when $_ =~ /enter/;
I tried many different ways, but none works so far. I figure that is
probablt has something to do with redirecting my STDOUT from my script
to the external program. How I do not know. If anyone can help, it
would be greatly apprecaited.
thanks.