I have successfully piped a print statement to gpg. My problem is
coming in
when I try to get it back out via a pipe. Can anyone tell me, is it
possible
to send data to a another program and the output back with out writing
it to
a file?

I want to change the method of piping because of some strange
problems:
If I run it from a shell on the server using the -d switch. It
generates the key and stores it correctly. The problem comes in when I
run it from the browser. It doesn't generate the key.
I would also like to change it for security reasons.

This is my code to pipe it to gpg:

sub scramble {
my $number = $_[0];
my $db = $_[1];
my $username = $_[2];
my $exp = $_[3];

&makeScratch();
if ($OS eq "windows") {
$outfile = ".\\$scratchPad\\"."temp1.txt";
$cmd = "c:\\gnupg\\gpg -ea -r ezbid > $outfile";
} else {
$outfile = "$scratchPad/"."temp1.txt";
$cmd = "gpg -ea -r ezbid --always-trust --no-secmem-warning >
$outfile";
}

open (GPGOUT, "| $cmd") || die "couldn't open GPGOUT";
print GPGOUT $number;
close GPGOUT;

open (FILEOUT, "< $outfile") or die "Can't open it: $!";
while (<FILEOUT>) {
$temp .= $_;
}
close FILEOUT;

$dbh=$db->prepare("update Members set tempnum = '$temp', ccexpire =
'$exp'
WHERE username='$username'");
$dbh->execute();

&cleanScratch;

return 1;
}



I have seen something in "Programing Perl"  about socketpairs and
pipe(read,
write) but when I tried it I got very confused.

Thanks,

David Gerler
Gerler Enterprises
PO Box 16357
Chesapeake VA 23328
(757) 410-0738
http://www.GerlerEnterprises.com/

Nationwide Dial-up from $12.45 /mo.
http://www.EasySitesForLess.com/



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to