in reply to GnuPG::Tie.pm does this
in thread Favorite PGP module for web-to-email forms?

..except the example code is failing for me. Here's what I have so far. It's dying when I try to read $ciphertext back from the filehandle. Can you offer suggestions or example code? Thanks! -mark
sub encrypt_text { use GnuPG::Tie::Encrypt; tie *CIPHER, 'GnuPG::Tie::Encrypt', armor => 1, recipient => $PUBL +IC_KEY_USER_ID || die; print CIPHER shift || die; local $/ = undef; my $ciphertext = <CIPHER> || croak "died here: $!"; close CIPHER; untie *CIPHER; return $ciphertext; }

Replies are listed 'Best First'.
RE(tilly) 1: GnuPG::Tie::Encrypt failing
by tilly (Archbishop) on Aug 19, 2000 at 03:21 UTC
    Really random guess. Did you successfully "make test" when you installed GnuPG::Tie::Encrypt? I just tried installing and it failed on the test because I didn't have gpg in my path...
RE: GnuPG::Tie::Encrypt failing (fixed)
by markjugg (Curate) on Aug 22, 2000 at 07:21 UTC
    The author was able to clue me in to the issue here. I think it was a "documentation bug". :) Adding this to my options fixed it:

    homedir => /path/to/.gnupg

    also adding: trace => 1 produced some useful debugging output.

RE: GnuPG::Tie::Encrypt failing (fixed)
by markjugg (Curate) on Oct 20, 2000 at 00:39 UTC
    This was fixed for me by adding this to the hash used to tie the variable:
    homedir => "$HOME_DIR/.gnupg"
    However, with version 0.07 there is a problem that the author has confirmed that causes a connection to a Postgres database through DBI to be disconnected when this encryption happens. Very Weird. -mark