in reply to accessing DOM from Perl?

As ikegami pointed out , you should be more specific , so because you are not specific I will make what I want of your question and consider that you want to write some Perl script that will use WWW::Selenium to control Selenium which will in turn control a browser by injecting js in it at runtime. So , quoting the WWW::Selenium documentation :
1)$sel->get_eval($script) Gets the result of evaluating the specified JavaScript snippet.
2)$sel->run_script($script) Creates a new "script" tag in the body of the current test window, and + adds the specified text into the body of the command. Scripts run in +this way can often be debugged more easily than scripts executed usin +gSelenium's "getEval" command. Beware that JS exceptions thrown in th +ese scripttags aren't managed by Selenium, so you should probably wra +p your scriptin try/catch blocks if there is any chance that the scri +pt will throwan exception.
You can download Selenium here , you want to download Selenium RC. Good luck !