From: Daniel Kahn Gillmor Date: Sat, 28 Feb 2009 19:08:41 +0000 (-0500) Subject: rewrite stdin slurping to match example in perldoc -f unpack. X-Git-Tag: monkeysphere_0.24~52^2~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b08a2e207f22000b494fc1aabe413bea5eb8f7d5;p=monkeysphere.git rewrite stdin slurping to match example in perldoc -f unpack. --- 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 = do { + local $/; # slurp! + ; + }; $rsa = Crypt::OpenSSL::RSA->new_private_key($stdin); }