So it works from command line, but gives a 500 error to user via CGI. But if I comment out references to gpg/GPG then the CGO works. So I dont think I have any code errors, it just looks like I have to do something else to enable CGI and crypt::gpg functionality? my hosting platform doesnt provide logs..#!/usr/bin/perl use Crypt::GPG; use CGI qw(:standard); my $gpg = new Crypt::GPG; $gpg->gpgbin('/usr/bin/gpg'); # The GnuPG executable $to='fake@name.com'; $from= 'fakefake@name.com'; $subject='request'; $ptext = "Primary Applicant:\nOptical Carrier); @ctext = $gpg->encrypt( $ptext, $to ); open(MAIL, "|/usr/sbin/sendmail -t"); print MAIL "To: $to\n"; print MAIL "From: $from\n"; print MAIL "Subject: $subject\n\n"; print MAIL $ctext[0]; close(MAIL); print <<END; Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html><head> <title>Thank you!</title></head> <body> <h1>Thank you!</h1> <p>Your application received, an encrypted message emailed out to Me:< +br>$ctext[0]<br> You can expect to hear from me soon!</p> </body></html> END
In reply to cannot use Crypt::GPG for CGI by opticalcarrier
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |