You should be able to open a pipe to gpg.  Here is something I've used
on Windows (watch for line wraps):

open(GPG,"|     gpg.exe -q --passphrase-fd 0 -o \"$decrypted\" -d
\"$encrypted\"");
print GPG 'passphrase'."\n";
close GPG;


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 03, 2006 8:28 AM
To: beginners@perl.org
Subject: fileno

<snip>


The equivalent Unix command would be

cat "file_with_passphrase_in_it " | gpg - -passphrase-fd=0 - -decrypt -
-
output "decrypted file" "encrypted file"

Here is my Perl code:

<snip>

open (PASS, "+<$pass") or die "was unable to open FH $!";
system($gpgbinary, $p . fileno(PASS),
       $de, $outp, $txtfile, $ascfile);

close (PASS) or warn "was unable to close pass FH $!";


<snip>




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to