use Crypt::OpenPGP; my $pgp = Crypt::OpenPGP->new ( "PubRing" => 'pubring.pkr' )or die Crypt::OpenPGP->errstr; my $ciphertext = $pgp->encrypt ( "Compat" => 'PGP5', "Data" => 'this is a test', "Recipients" => 'Garett L Holmes', "Armour" => 1, );
die "Encryption failed: ", $pgp->errstr unless $ciphertext; print $ciphertext;