in reply to Using Crypt::OpenPGP with large files

Why are you using open/$fh?
  • Comment on Re: Using Crypt::OpenPGP with large files

Replies are listed 'Best First'.
Re^2: Using Crypt::OpenPGP with large files
by roperl (Beadle) on Jul 24, 2017 at 21:57 UTC
    Is there anything wrong with that? Need to open $fh to output file and then print to the output file the plain text after it was decrypted. Still the issue is the decrypt function returns to variable as opposed to being able to pass output filehandle

      Well, you could just as well do this:

      $fh = $pgp->decrypt(Filename => $file, Passphrase => $pp);

      But depending on how that method works, you may not see any improvement. Worth a try though.

        All the code slurps files. Not a bad approach for starters, but it inevitably runs into memory limits

      Is there anything wrong with that? Need to open $fh to output file and then print to the output file the plain text after it was decrypted.

      But your code does not try to print anything to $fh, all it does is create an empty file ..

      Still the issue is the decrypt function returns to variable as opposed to being able to pass output filehandle

      Yeah decrypt doesn't do that

      You can make a feature request or bug report at rt://Crypt-OpenPGP ( bug-Crypt-OpenPGP@rt.cpan.org )

      It would be nice if decrypt didnt slurp giant files

        Your right, $fh = $pt; should have been print $fh $pt; I think copied the incorrectly into my original post