#!/usr/bin/perl -w use strict; use CGI::Carp qw(fatalsToBrowser); #show us the errors in the browser use GPG; #the GPG perl module my $gpg = new GPG( #create a new GPG object homedir => '/home/xxxxxx/.gnupg', #specify the directory gnupg_path => '/usr/bin', #non-standard path to gpg binary armor => '1', #make sure the output is ascii armored debug => '1' #debug mode to trouble shoot ); my $encrypted = $gpg->encrypt("Testing GPG", 'xxxx@xxxxx.com'); # This is where things break down. # GPG's debug looks fine but # I am unable to use the resulting scalar. print <<"_END_"; Content-type: text/plain Encrypted: -> $encrypted <- _END_