Re: Fwd: Mech JS support

Re: Fwd: Mech JS support

am 19.07.2007 09:19:20 von scratchcomputing

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

>for everyoneâ€=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=20
false, why not just put=20

return unless $self->{_extracted_forms}

inside the _extract_forms() method?

Also, I would guess that separate init() and options() methods would be=20
preferable in writing plugins rather than having init() handle options=20
and self but options() gets just options. Similarly, the init() call=20
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(@opts).

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

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

=2D-Eric
=2D-=20
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--------------------------------------------------