Post to WordPress in Perl (xmlrpc)

Filed under: Perl tips — vincent @ 23:29

Today, I had to enable a custom program to inject posts in a WordPress blog. Since WordPress implements not less than 3 differents APIs to this effect, through XMLRPC, the choice of the technology was easy: Perl and xmlrpc.

The task was complicated by the fact that the page was only accessible by passing through an HTTP Basic Authentication.


Get the element from a hash

Filed under: Perl tips — vincent @ 15:02

I’ve tripped on this simple question:
Having a perl hash %h, and knowing that is has only one element, how to get to this element as easily / as efficiently as possible? Of course, we suppose here that you don’t know the key corresponding to this element…