diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2009-02-28 14:08:41 -0500 |
---|---|---|
committer | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2009-02-28 14:08:41 -0500 |
commit | b08a2e207f22000b494fc1aabe413bea5eb8f7d5 (patch) | |
tree | 66f9fa75bb8bd1fe12293496dfb1a7e07da62522 | |
parent | e83267c80493b9279bd35e8adf91963d0ec6f0b6 (diff) |
rewrite stdin slurping to match example in perldoc -f unpack.
-rwxr-xr-x | src/keytrans/pem2openpgp | 8 |
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); } |