summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-02-28 14:08:41 -0500
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-02-28 14:08:41 -0500
commitb08a2e207f22000b494fc1aabe413bea5eb8f7d5 (patch)
tree66f9fa75bb8bd1fe12293496dfb1a7e07da62522
parente83267c80493b9279bd35e8adf91963d0ec6f0b6 (diff)
rewrite stdin slurping to match example in perldoc -f unpack.
-rwxr-xr-xsrc/keytrans/pem2openpgp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/keytrans/pem2openpgp b/src/keytrans/pem2openpgp
index 3492361..4e6ebe7 100755
--- a/src/keytrans/pem2openpgp
+++ b/src/keytrans/pem2openpgp
@@ -509,12 +509,14 @@ sub pem2openpgp {
my $rsa;
+my $stdin;
if (defined $ENV{PEM2OPENPGP_NEWKEY}) {
$rsa = Crypt::OpenSSL::RSA->generate_key($ENV{PEM2OPENPGP_NEWKEY});
} else {
- # slurp in the entire stdin:
- undef $/;
- my $stdin = <STDIN>;
+ $stdin = do {
+ local $/; # slurp!
+ <STDIN>;
+ };
$rsa = Crypt::OpenSSL::RSA->new_private_key($stdin);
}