Re: IPC:Open3 does not work under mod_perl/1.25, perl5.6.0?

2001-04-30 Thread Peter Reif

Thanks! This works for me, I don't have Apache::Filter loaded, but the
effect is the same.

My new code:

my $stdin = tied *STDIN;
my $stdout = tied *STDOUT;
untie *STDIN;
untie *STDOUT;
my $child = open3 ($cgi_in, $cgi_out, $cgi_error, $filename);
tie *STDIN, ref $stdin, $stdin;
tie *STDOUT, ref $stdout, $stdout;



Re: IPC:Open3 does not work under mod_perl/1.25, perl5.6.0?

2001-04-27 Thread Michael J Schout

I can verify for you that this is a problem.

You wouldnt happen to be using Apache::Filter would you?

I've posted this problem at least once over the past year, and I have seen it
posted by others.  I had this porblem trying to oepn3() a pipe to gnupg and
encrypt some data. I later switched to the GnuPG::Tie package and had similar
problems.

After much head scratching I figured out that I was using Apache::Filter and I
needed to first untie STDIN and STDOUT before I could make things work.

My ugly hack around it basically was this:

my ($stdin, $stdout);
if (lc $this-request-dir_config('Filter') eq 'on') {
# undo Apache::Filter mess.
$stdin = tied *STDIN;
$stdout = tied *STDOUT;
untie *STDIN;
untie *STDOUT;
}
 use GnuPG::Tie::Encrypt to encrypt data ...
if (lc $this-request-dir_config('Filter') eq 'on') {
# now retie STDIN, STDOUT for Apache::Filter
tie *STDIN, ref $stdin, $stdin;
tie *STDOUT, ref $stdout, $stdout;
}

I havent tried a similar solution for IPC::Open3, but you may want to try this
if you are using Apache::Filter.

Its not pretty, but it works for me :).

Mike