(Ideally I would add a comment, but I don't have enough reputation yet to do so.)
Dokuwiki's xmlrpc will returns a 401-Unauthorized if the remote user is unknown. (it would be a 403-Forbidden if the user is known but doesn't have enough permissions)
It can be the case in particular if your xmlrpc module doesn't deal with cookies since dokwiki.login relies on them
I don't know RPC::XML::Client, but a quick search didn't show that it deals naturally with cookies. You might want to make sure it's the case, or check how to handle them.
Alternatively, if you're not stuck with perl, you might wan to have a look at DokuJClient, an xmlrpc java client for Dokuwiki.