external program

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

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

here is an example:
-- external script
print "enter something \n";
my $i = <>;
print "your input: $i";

-- my script:
open(TE, "perl externalScript.pl|") or die "no";
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.


Site Timeline