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

Reply via email to