use Crypt::OpenPGP; $pgp = Crypt::OpenPGP->new ( "PubRing" => 'pubring.pkr' )or die Crypt::OpenPGP->errstr; my $ciphertext = $pgp->encrypt ( "Data" => 'This is a test', "Recipients" => 'myemail\@blah.com', "Cipher" => 'DES3', "Armour" => 1 ); die "Encryption failed: ", $pgp->errstr unless $ciphertext; print $ciphertext;