use Crypt::OpenPGP; use Crypt::OpenPGP::KeyRing; $pgp = Crypt::OpenPGP->new(PubRing => 'test.public'); $crypt = $pgp->encrypt( Compat => 'PGP5', Data => 'squeamish ossifrage', Recipients => 'gaholmes\@hotmail.com', Armour => 1, ); defined($crypt) ? print $crypt : die $pgp->errstr;