I am currently working on a script which involves some RSA encryption, as well as MD5 work.
Here is the troublesome subroutine:
sub get_pubkey {
my $issuer = shift;
my %hash;
tie %hash, 'BerkeleyDB::Hash', -Filename => "/home/httpd/newkeyrin
+g" or die "Cannot tie the hash to that file: $! $BerkeleyDB::Error\n"
+;
open(TEST, ">> fields_data");
foreach my $hashkey (keys %hash) {
print TEST "The pubkey is: $hashkey\n";
print TEST "The value is: $hash{$hashkey}\n";
print "The pubkey is: $hashkey<br>\n";
print "The value is: $hash{$hashkey}<br>\n";
}
my $server = "$issuer" . ".PUBLIC";
my $val = $hash{$server};
close(TEST);
untie %hash;
print "Server is : $server<br>\n";
print "Public key currently is: $val<br>\n";
return $val;
}
Everything seems fine (It all prints out - %hash only contains 2 keys and 2 values) until the final print
of the Public Key - THAT comes up blank. $server is set fine,
but $val is empty. The sub also returns nada. Can anyone see what
I am doing wrong to cause this?
What does this little button do . .<Click>;
"USER HAS SIGNED OFF FOR THE DAY"