my $client = new JSON::RPC::Client;
$client->ua->credentials(
'localhost:8332', 'jsonrpc', 'user' => 'password'
);
my $uri = 'http://localhost:8332/';
my $obj = {
method => 'sendfrom',
params => [$account,$sendto,$btc,6], };
my $res = $client->call( $uri, $obj );
if ($res){
if ($res->is_error) { print "Error : ", $res->error_message; }
else { print Dumper($res->result); }
} else {
print $client->status_line;
}
Considering the code above $btc is accepted as a param if it is declared:
$btc = 0.01;
Not accepted if it is:
$btc = 0.01;
$btc = sprintf('%.8f', $btc);
Also not accepted if it is:
&ReadParse(*data);
$btc = $data{'amount'};
I get "500 internal server" error