From b08a2e207f22000b494fc1aabe413bea5eb8f7d5 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Sat, 28 Feb 2009 14:08:41 -0500 Subject: rewrite stdin slurping to match example in perldoc -f unpack. --- src/keytrans/pem2openpgp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/keytrans/pem2openpgp') 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); } -- cgit v1.2.3