The first version of my dominions perl library is done.
Currently there are function for map parsing/validation, functions to add random buildings and commanders to provinces, and of course a function to output the edited map code from the perl psudo-object
The library come with a test script (test.pl) as well as an online map validator/randomizer also available on my website , so you don't even need to install anything if you just want to randomize a map or two :
http://dominions.realites.org/
I have many plans for the future based on this library, such as semi-random provinces (randomly select random provinces/commanders from a preset library depending of the province terrain type(s) for exemple), and I can take suggestion, or even script requests.
And of course please report any bug that you could find with the application, thanks in advance.