I have successfully pipe 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?

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,

Dave




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

Reply via email to