P
Pranab Mehta
Hi All,
I'm trying to automate data entry to a windows app using wine from my
linux machine. I'm not very proficient with my Perl, hence this post.
Pretty simple scenario, I kick off a process, write to it, and then
want to read from it. But nothing ever prints in the output. Here's
the code in question -
$pid = open2(READHDLR, WRITEHDLR, "wine win_app.exe") or die "can't
run command: $!";
WRITEHDLR->autoflush();
READHDLR->autoflush();
print "PID = $pid\n";
print WRITEHDLR $PIN;
print WRITEHDLR "\x0d\x0a";
$got=<READHDLR>;
print "output = $got";
Now if I were to replace READHDLR with a FILEHANDLE for writing, like
this:
open(OUTFILE, "> outfile");
open2(">&OUTFILE", ...);
I can see _all_ the data from the win_app in the file. Then why can't
I read this data from READHDLR ?
Further, I don't know if this is valid, but if I pipe the output of
READHDLR to a file, like this:
open(READHDLR, "| tee outfile");
the file turns out empty.
What am I missing ?
Please someone set me on the right path ...
Thanks much,
Pranab
I'm trying to automate data entry to a windows app using wine from my
linux machine. I'm not very proficient with my Perl, hence this post.
Pretty simple scenario, I kick off a process, write to it, and then
want to read from it. But nothing ever prints in the output. Here's
the code in question -
$pid = open2(READHDLR, WRITEHDLR, "wine win_app.exe") or die "can't
run command: $!";
WRITEHDLR->autoflush();
READHDLR->autoflush();
print "PID = $pid\n";
print WRITEHDLR $PIN;
print WRITEHDLR "\x0d\x0a";
$got=<READHDLR>;
print "output = $got";
Now if I were to replace READHDLR with a FILEHANDLE for writing, like
this:
open(OUTFILE, "> outfile");
open2(">&OUTFILE", ...);
I can see _all_ the data from the win_app in the file. Then why can't
I read this data from READHDLR ?
Further, I don't know if this is valid, but if I pipe the output of
READHDLR to a file, like this:
open(READHDLR, "| tee outfile");
the file turns out empty.
What am I missing ?
Please someone set me on the right path ...
Thanks much,
Pranab