Re: Fwd: Mech JS support

# from Father Chrysostomos
# on Wednesday 18 July 2007 10:26 pm:

>for everyone=E2=80=99s perusal.

I'm seeing this a lot.

+ $self->_extract_forms() unless $self->{_extracted_forms};

Given that it is a void-context and is a noop if _extracted_forms is
false, why not just put

return unless $self->{_extracted_forms}

inside the _extract_forms() method?

Also, I would guess that separate init() and options() methods would be
preferable in writing plugins rather than having init() handle options
and self but options() gets just options. Similarly, the init() call
should get $self as the first parameter such as:

my $plugin_init =3D "WWW::Mechanize::Plugin::$plugin" . '::init';
$self->$plugin_init()

And similarly for $self->$plugin_options( [at] opts).

That is, unless the plugin is an object, which maybe it should be. What
do the plugin class-methods do for state storage? They just throw keys
into the $mech object?

It seems that you can have multiple plugins, but they overwrite
callbacks as they're installed?

=2D-Eric
=2D-
So malloc calls a timeout and starts rummaging around the free chain,
sorting things out, and merging adjacent small free blocks into larger
blocks. This takes 3 1/2 days.
=2D-Joel Spolsky
=2D--------------------------------------------------
http://scratchcomputing.com
=2D--------------------------------------------------
scratchcomputing [ Do, 19 Juli 2007 09:19 ] [ ID #1773489 ]
Perl » perl.libwww » Re: Fwd: Mech JS support

Vorheriges Thema: libwww-perl-5.806 causes data loss in HTTP Headers
Nächstes Thema: Rare Fatal Errors using Threads and libwww