The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

overload.t

SYNOPSIS

This tests for various ways, advertised in WWW::Mechanize, to create a subclass of the mech to alter it's behavior in a useful manner. (Of course free-style overloading is discouraged, as it breaks encapsulation big time.)

This test first feeds some bad HTML to Mech to make sure that it throws an error. Then, it overloads update_html() to fix the HTML before processing it, and then we should not have an error.

Overloading update_html()

This is the recommended way to tidy up the received HTML in a generic way, and/or to install supplemental "surface tests" on the HTML (e.g. link checker).