Tie-Handle-ToMemory - Re: Implement UNTIE ?

Posted on Tue Jul 25 13:28:24 2006 by dagolden in response to 2690 (See the whole thread of 2)
Re: Implement UNTIE ?

Well, the honest answer is that I didn't implement UNTIE because I wrote this long enough ago that I didn't realize I needed to! I wrote Tie::Handle::ToMemory for a very specific purpose where I needed/wanted a FIFO queue.

For your purpose, collecting output from a program, I suggest you consider several alternatives. Personally, I use IPC::Run3 for that kind of thing. It's very portable and works like this:

use IPC::Run3; my ($out, $err); my @cmd = qw/program -abc input.txt/; # or whatever run3 \@cmd, undef, \$out, \$err; # $out and $err will have the output of the run

Regards, David

Write a response