in reply to [SOLVED] WWW::Mechanize select() method fails

Ureka: I tested the select() method on another SELECT tag in the same form, and it worked.

But not with the example above.

The difference? That blank first option:

<option value="" selected></option>

For some reason, Mechanize, or possibly HTML::Form, doesn't like it.

Luckily, Mechanize has an HTML-fixing option:

my $html = $mech->content; $html =~ s[<option value=""( selected)?></option>][]isg; $mech->update_html( $html );
And now, with that workaround, everything's fine.

My question now is, who do I tell about this bug?



($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
=~y~b-v~a-z~s; print

Replies are listed 'Best First'.
Re^2: WWW::Mechanize select() method fails
by Corion (Patriarch) on Nov 01, 2004 at 08:10 UTC

    The standard way of telling people about bugs would be the CPAN ticket tracker, but you can also email the report to RT, as detailed in the gasp documentation.

    Of course, as always, a short test/program together with the input data and the expectations, preferably using Test::More greatly improves the chance of the bug getting fixed as soon as possible :-)

    Update: As I look on CPAN, petdance has just released WWW::Mechanize 1.05_03, which seems to make the select method return a true value in all cases. If that fixes your bug I don't know, but you might want to test against the current developer release before submitting the bug.

      Thanks for that -- yet another question arising, how do I get CPAN to install that one, rather than what it thinks is the current "up to date" release?


      ($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
      =~y~b-v~a-z~s; print
        You don't. You have to manually download, build and install it yourself.

        xoxo,
        Andy

Re^2: WWW::Mechanize select() method fails
by perrin (Chancellor) on Nov 01, 2004 at 20:15 UTC
    I think the problem might be that it was returning the value of that option, which is false.