in reply to works as a perl script, but not as cgi

Check on the path to gpg and whether or not the user the webserver runs as has permission to run it. And sed.

Update: running with -T (taint) may also be affecting your output. Check out perlsec



--chargrill
s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)