opticalcarrier has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: cannot use Crypt::GPG for CGI
by Anonymous Monk on Jun 15, 2016 at 00:37 UTC | |
by opticalcarrier (Initiate) on Jun 15, 2016 at 05:20 UTC | |
by afoken (Chancellor) on Jun 15, 2016 at 05:54 UTC | |
by opticalcarrier (Initiate) on Jun 15, 2016 at 15:01 UTC | |
by FloydATC (Deacon) on Jun 15, 2016 at 07:04 UTC | |
|
Re: cannot use Crypt::GPG for CGI
by stevieb (Canon) on Jun 15, 2016 at 00:38 UTC |