in reply to CGI and GPG, how are you people doing it?

I think that you’re getting a bit of the run-around here, and it might be because you really haven’t told us anything about your errors other than that you’re having them.

Remember that any CGI script runs in the context of the Apache server, generally as nobody, who of course has no access to anything, and might even be forbidden to execute external commands.   Regarding #1, “consider that.”

If errors occur, they generally will be reported in the Apache error_log file for that server.   Anything that you print STDERR ... will also wind up there.   Regarding #2, “look there.”

Start by running “the guts of your script,” as yourself, to see that in fact it works and to get the bugs out.   Figure out how Crypt::GPG works, appropriate to your circumstances, and get the bugs out of your code.   Only then, adapt the same thing to be used by nobody in a CGI context.

(Or, this being the PerlMonks Code-Writing Service,™ post a fragment of your code.   Within fifteen minutes’ time, three other Monks will have [re-]written the entire program for you.)   ;-)