Posted on 2008-11-09 20:25:26-08 by alabarga
arrays of strings
Hi, I have an array of strings that happend to be integer ids, ['15941477''12524078','12387826','16051896','12192298','15882815','16320350','12783121','16303771','12070304']) how can I force the request to be an array of string insted of i4? thanks
Direct Responses: 9286 | Write a response
Posted on 2008-11-12 09:16:52-08 by charlie in response to 9271
Re: arrays of strings
you can override the automatic type recognition by passing a coderef instead of a scalar value e.g. instead of
$xmlrpc->call("myrpc", ['12345', '123456']);
try
$xmlrpc->call("myrpc", [ sub { return{ "string" => '12345' } }, sub { return{ "string" => '123456' } }, ]);
good luck.
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.