P
Paul Lalli
Ashwin said:Here is my complete code ,
Your "complete code" doesn't compile. Try again. Copy and paste,
don't retype.
Also, from your description, are you sure you shouldn't be using the
Expect module from CPAN?
Paul Lalli
Ashwin said:Here is my complete code ,
Paul said:Your "complete code" doesn't compile. Try again. Copy and paste,
don't retype.
Also, from your description, are you sure you shouldn't be using the
Expect module from CPAN?
Paul Lalli
Ashwin said:SOrry, I missee one quatation
here is compiled code,
is there no way I can get it done with open2?
use warnings;
use strict;
use IPC::Open2;
use Cwd;
my $currentdir=cwd();
my $pid;
chdir ("/source/internal/") or die "Cannot Change Directory";
$pid = open2 (\*READ,\*MY_WRITE,"BuildInternal.pl") or die;
while (<READ>)
{
print $_;
}
print "MY_WRITE\n";
while (<READ>)
{
print $_;
}
close MY_WRITE;
close READ;
Paul said:Get what done? I don't see anywhere in the code below in which you
attempted to write to the process.
Here you open the process BuildInternal.pl, with a read filehandle
READ and a write filehandle MY_WRITE
Here you begin reading from READ
Here you print the lines read from READ out to STDOUT
Here you print the string "MY_WRITE\n" out to STDOUT
Here you again read from READ
Here you again print the lines read from READ out to STDOUT
Here you close both filehandles.
What part of this code were you expecting to write anything to the
MY_WRITE filehandle?
Paul Lalli
print MY_WRITE "4\n";print "MY_WRITE\n"; should have been
Ashwin said:Paul Lalli wrote:
sorry for missing the valid part
this part of the script
print MY_WRITE "4\n";
to clarify that value 4 need to be written in output handle and then a
carridge return so that called script gets value as 4
Ian said:Do you mean that your script contained
print "MY_WRITE\n";
end you have now corrected it to
print MY_WRITE "4\n";
and everything is OK now?
Or do you mean your script contained the latter all along but that
instead of using copy & paste you are still retyping and making
typing mistakes. In which case you still want help?
IIRC on a Unix host, "\n" will emit a linefeed character, not the
carriage-return character you mention. This might be causing you
problems?