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$/

In reply to Re: Customizing WWW::Mechanize by jonadab
in thread Customizing WWW::Mechanize by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.