in reply to Customizing WWW::Mechanize

There are a number of ways to extend WWW::Mechanize, and this is a good one. I can't think of any other specific warnings (unless you want to turn it into a validator), but I did run into a situation the other day wherein a different type of extension would have saved me time. I was writing a script that fetches usage statistics for some online databases that the library subscribes to, and at one point it needed to follow a link like this:

<a href="javascript:doAdminHyperlink('/eadmin/Profiles/CustomizeServicesDatabasesForm.aspx','','')">

As an added bonus, doAdminHyperlink was defined in an external .js file that was linked in. Now, browsers have no trouble with this, but I had to retrieve the script, find the function, and translate into Perl the important parts of what it was doing. (It changes a couple of the form's values and submits it.) I ended up doing $mech->set_fields( some stuff); $mech->click(); but I had to read a twenty-some-line function in a language I don't really know in order to find out that that was what I needed to do.

So, an ECMA script and DOM extension for WWW::Mechanize would be nifty. It would have to be optional, of course. Note that I'm not asking you to add this to your warnings module :-) Just pointing out another example of what you're driving at: WWW::Mechanize is a really cool beginning, but it could be much more.


$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/