Posted by on 2014-02-19 00:36

I'm using ActivePerl 5.16.3

Consider the snippet below ... ugly but it does work:
system("some_program > /tmp/xyz.txt");
$fh = Tkx::open("/tmp/xyz.txt");
$stuff = Tkx::read($fh, 16384);

The above sequence is purely notional ... and does not accurately reflect
my actual code ... it merely shows the sort of code that does actually work.

I actually want to do:
$fh = Tkx::open("some_program |");
Tkx::fileevent($fh, readable=>[\&GetInfo]);

"some_program" drip feeds status information which would get collected by the call-back
However, using Tkx::open() on anything other than a simple file creates an error as in:

couldn't open "cat /tmp/xx.yy |": no such file or directory at /shares/common/tools/freeware/activeperl/ActivePerl-5.16/lib/ line 566, line 7.

I've tried to use:
open($fh, "some_program |");

where $fh is a GLOB of type FileHandle
and used that with Tkx::open() and/or with Tkx::fileevent ... but again to no avail.

Question: Is it possible to use Tkx::open in the desired manner ... or is there another way?