in reply to Get data from javascript

For any specific Javascript, you can implement the same function in Perl and then get the result that way.

If you want a generic solution for getting the result of arbitrary Javascript code, you will have to run the Javascript. Example environments for Javascript in a web context could be WWW::Mechanize::Firefox and WWW::Mechanize::PhantomJS.