diff -Nru libwww-mechanize-perl-1.86/bin/mech-dump libwww-mechanize-perl-1.88/bin/mech-dump --- libwww-mechanize-perl-1.86/bin/mech-dump 2017-07-04 15:48:55.000000000 +0000 +++ libwww-mechanize-perl-1.88/bin/mech-dump 2018-03-23 15:37:36.000000000 +0000 @@ -38,11 +38,7 @@ ) or pod2usage(2); -my $uri = shift or die "Must specify a URL or file to check. See --help for details.\n"; -if ( -e $uri ) { - require URI::file; - $uri = URI::file->new_abs( $uri )->as_string; -} +my @uris = @ARGV or die "Must specify a URL or file to check. See --help for details.\n"; @actions = (\&dump_forms) unless @actions; @@ -65,20 +61,27 @@ } $mech->env_proxy(); -my $response = $mech->get( $uri ); -if (!$response->is_success and defined ($response->www_authenticate)) { - if (!defined $user or !defined $pass) { - die("Page requires username and password, but none specified.\n"); - } - $mech->credentials($user,$pass); - $response = $mech->get( $uri ); - $response->is_success or die "Can't fetch $uri with username and password\n", $response->status_line, "\n"; -} -$mech->is_html or die qq{$uri returns type "}, $mech->ct, qq{", not "text/html"\n}; - -while ( my $action = shift @actions ) { - $action->( $mech ); - print "\n" if @actions; +foreach my $uri (@uris) { + if ( -e $uri ) { + require URI::file; + $uri = URI::file->new_abs( $uri )->as_string; + } + + my $response = $mech->get( $uri ); + if (!$response->is_success and defined ($response->www_authenticate)) { + if (!defined $user or !defined $pass) { + die("Page requires username and password, but none specified.\n"); + } + $mech->credentials($user,$pass); + $response = $mech->get( $uri ); + $response->is_success or die "Can't fetch $uri with username and password\n", $response->status_line, "\n"; + } + $mech->is_html or die qq{$uri returns type "}, $mech->ct, qq{", not "text/html"\n}; + + foreach my $action (@actions ) { + $action->( $mech ); + print "\n" if @actions; + } } @@ -128,7 +131,7 @@ =head1 VERSION -version 1.86 +version 1.88 =head1 SYNOPSIS diff -Nru libwww-mechanize-perl-1.86/Changes libwww-mechanize-perl-1.88/Changes --- libwww-mechanize-perl-1.86/Changes 2017-07-04 15:48:55.000000000 +0000 +++ libwww-mechanize-perl-1.88/Changes 2018-03-23 15:37:36.000000000 +0000 @@ -1,6 +1,33 @@ Revision history for WWW::Mechanize +1.88 2018-03-23 15:37:25Z +======================================== + [FIXED] + - tick() now dies if checkbox is not found (GH#248) (Olaf Alders) + + [DOCUMENTATION] + - Clarify behaviour of submit_form when with_fields is supplied as an arg (GH#247) (Olaf Alders) + - Document some "Best Practices" (GH#246) (Olaf Alders) + - Update links in Pod. Suggest LWP::ConsoleLogger rather than LWP::Debug (GH#244) (Olaf Alders) + +1.87 2018-02-07 22:04:16Z +======================================== + [FIXED] + - Fix typo in contributor name (GH#241) (Philippe Bruhat (BooK)) + - Fix link to Michael Schilli's article in Linux magazine (GH#240) (Bernhard Wagner) + - Fix some section links (GH#238) (Evan Zacks) + - Override _agent() method. (GH#236) (Сергей Романов) + - Link to appropriate section of HTML::Form (GH#237) (Evan Zacks) + - Make version consistent in .pm files (GH#231) (Olaf Alders) + + [ENHANCEMENTS] + - Return form number in list context. (GH#235) (Сергей Романов) + - Overload 'post' in order to set 'base'. (GH#111) (Stuart A Johnston) + - Allow multiple file paths/uris in mech-dump; fixes issue 72 (GH#113) (Nik LaBelle) + - Add docs for the output of dump_forms (GH#112) (John Beppu) + 1.86 2017-07-04 15:48:46Z +======================================== [FIXED] - use 127.0.0.1 instead of 'localhost' in a test script to avoid the test hanging due to ipv6 issues (GH#31, see also changes in 1.85) @@ -27,6 +54,7 @@ Etheridge) 1.84 2017-03-07 13:34:57-05:00 America/Toronto +======================================== [ENHANCEMENTS] - Parse url (href attribute) for js window.open GH#11 diff -Nru libwww-mechanize-perl-1.86/CONTRIBUTORS libwww-mechanize-perl-1.88/CONTRIBUTORS --- libwww-mechanize-perl-1.86/CONTRIBUTORS 2017-07-04 15:48:55.000000000 +0000 +++ libwww-mechanize-perl-1.88/CONTRIBUTORS 2018-03-23 15:37:36.000000000 +0000 @@ -8,6 +8,7 @@ * Alexandr Ciornii * Andy Lester + * Bernhard Wagner * Chase Whitener * dakkar * Dave Doyle @@ -15,6 +16,7 @@ * David Steinbrunner * Desmond Daignault * Ed Avis + * Evan Zacks * Flavio Poletti * Florian Schlichting * Gabor Szabo @@ -22,6 +24,7 @@ * Grigor Karavardanyan * Jason May * Jesse Vincent + * John Beppu * Karen Etheridge * Kirrily 'Skud' Robert * Kivanc Yazan @@ -31,12 +34,15 @@ * Matt S Trout * Max Maischein * Neil Bowers + * Nik LaBelle * Olaf Alders + * Philippe Bruhat (BooK) * Ricardo Signes * Schuyler Langdon * Sergey Romanov * simbabque * Steve Scaffidi + * Stuart Johnston * sunnavy * Varadinsky * Ville Skyttä diff -Nru libwww-mechanize-perl-1.86/cpanfile libwww-mechanize-perl-1.88/cpanfile --- libwww-mechanize-perl-1.86/cpanfile 2017-07-04 15:48:55.000000000 +0000 +++ libwww-mechanize-perl-1.88/cpanfile 2018-03-23 15:37:36.000000000 +0000 @@ -65,3 +65,7 @@ requires "constant" => "0"; requires "lib" => "0"; }; + +on 'develop' => sub { + recommends "Dist::Zilla::PluginBundle::Git::VersionManager" => "0.005"; +}; diff -Nru libwww-mechanize-perl-1.86/debian/changelog libwww-mechanize-perl-1.88/debian/changelog --- libwww-mechanize-perl-1.86/debian/changelog 2017-09-24 12:59:13.000000000 +0000 +++ libwww-mechanize-perl-1.88/debian/changelog 2018-05-07 18:29:48.000000000 +0000 @@ -1,3 +1,22 @@ +libwww-mechanize-perl (1.88-1) unstable; urgency=medium + + [ Damyan Ivanov ] + * declare conformance with Policy 4.1.3 (no changes needed) + + [ Salvatore Bonaccorso ] + * Update Vcs-* headers for switch to salsa.debian.org + + [ gregor herrmann ] + * Import upstream version 1.88. + * Drop html-form-input.patch, fixed upstream. + * Update years of upstream and packaging copyright. + * Declare compliance with Debian Policy 4.1.4. + * Bump debhelper compatibility level to 10. + * Add a patch to fix a typo in a POD directive. + * Add a duck-overrides for false positives about a moved domain. + + -- gregor herrmann Mon, 07 May 2018 20:29:48 +0200 + libwww-mechanize-perl (1.86-1) unstable; urgency=medium [ gregor herrmann ] diff -Nru libwww-mechanize-perl-1.86/debian/compat libwww-mechanize-perl-1.88/debian/compat --- libwww-mechanize-perl-1.86/debian/compat 2015-08-14 21:54:30.000000000 +0000 +++ libwww-mechanize-perl-1.88/debian/compat 2018-05-07 18:29:48.000000000 +0000 @@ -1 +1 @@ -9 +10 diff -Nru libwww-mechanize-perl-1.86/debian/control libwww-mechanize-perl-1.88/debian/control --- libwww-mechanize-perl-1.86/debian/control 2017-09-24 12:59:13.000000000 +0000 +++ libwww-mechanize-perl-1.88/debian/control 2018-05-07 18:29:48.000000000 +0000 @@ -6,7 +6,7 @@ Section: perl Testsuite: autopkgtest-pkg-perl Priority: optional -Build-Depends: debhelper (>= 9) +Build-Depends: debhelper (>= 10) Build-Depends-Indep: perl, libcgi-pm-perl (>= 4.32), libhtml-form-perl, @@ -31,9 +31,9 @@ liburi-perl, libwww-perl, netbase -Standards-Version: 4.1.0 -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/libwww-mechanize-perl.git -Vcs-Git: https://anonscm.debian.org/git/pkg-perl/packages/libwww-mechanize-perl.git +Standards-Version: 4.1.4 +Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libwww-mechanize-perl +Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libwww-mechanize-perl.git Homepage: https://metacpan.org/release/WWW-Mechanize Package: libwww-mechanize-perl diff -Nru libwww-mechanize-perl-1.86/debian/copyright libwww-mechanize-perl-1.88/debian/copyright --- libwww-mechanize-perl-1.86/debian/copyright 2017-09-24 12:43:55.000000000 +0000 +++ libwww-mechanize-perl-1.88/debian/copyright 2018-05-07 18:29:48.000000000 +0000 @@ -4,7 +4,7 @@ Source: https://metacpan.org/release/WWW-Mechanize Files: * -Copyright: 2004-2017, Andy Lester +Copyright: 2004-2016, Andy Lester License: Artistic or GPL-1+ Files: t/local/LocalServer.pm @@ -17,7 +17,7 @@ 2007-2009, Rene Mayorga 2008, Kees Cook 2009, Ryan Niebur - 2009-2016, gregor herrmann + 2009-2018, gregor herrmann 2010, Ansgar Burchardt 2010-2011, Nicholas Bamber 2013-2017, Florian Schlichting diff -Nru libwww-mechanize-perl-1.86/debian/duck-overrides libwww-mechanize-perl-1.88/debian/duck-overrides --- libwww-mechanize-perl-1.86/debian/duck-overrides 1970-01-01 00:00:00.000000000 +0000 +++ libwww-mechanize-perl-1.88/debian/duck-overrides 2018-05-07 18:29:48.000000000 +0000 @@ -0,0 +1,3 @@ +# false positives: m/no longer.* maintain/i +https://github.com/libwww-perl/WWW-Mechanize.git +https://github.com/libwww-perl/WWW-Mechanize diff -Nru libwww-mechanize-perl-1.86/debian/patches/autopkgtest.patch libwww-mechanize-perl-1.88/debian/patches/autopkgtest.patch --- libwww-mechanize-perl-1.86/debian/patches/autopkgtest.patch 2016-08-18 19:09:02.000000000 +0000 +++ libwww-mechanize-perl-1.88/debian/patches/autopkgtest.patch 2018-05-07 18:29:48.000000000 +0000 @@ -1,6 +1,6 @@ Description: update path to mech-dump script during autopkgtest Origin: vendor -Forwarded: not needed +Forwarded: not-needed Author: gregor herrmann Last-Update: 2016-08-09 diff -Nru libwww-mechanize-perl-1.86/debian/patches/html-form-input.patch libwww-mechanize-perl-1.88/debian/patches/html-form-input.patch --- libwww-mechanize-perl-1.86/debian/patches/html-form-input.patch 2017-09-24 12:59:13.000000000 +0000 +++ libwww-mechanize-perl-1.88/debian/patches/html-form-input.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -Description: help users find the POD for HTML::Form::Input -Author: Florian Schlichting -Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751465 -Forwarded: https://github.com/libwww-perl/WWW-Mechanize/issues/234 - ---- a/lib/WWW/Mechanize.pm -+++ b/lib/WWW/Mechanize.pm -@@ -2251,7 +2251,8 @@ - - find_all_inputs() returns an array of all the input controls in the - current form whose properties match all of the regexes passed in. --The controls returned are all descended from HTML::Form::Input. -+The controls returned are all descended from HTML::Form::Input -+(see HTML::Form's "Input" section for details). - - If no criteria are passed, all inputs will be returned. - diff -Nru libwww-mechanize-perl-1.86/debian/patches/pod-syntax.patch libwww-mechanize-perl-1.88/debian/patches/pod-syntax.patch --- libwww-mechanize-perl-1.86/debian/patches/pod-syntax.patch 1970-01-01 00:00:00.000000000 +0000 +++ libwww-mechanize-perl-1.88/debian/patches/pod-syntax.patch 2018-05-07 18:29:48.000000000 +0000 @@ -0,0 +1,27 @@ +Description: fix a POD syntax error + POD ERRORS + Hey! The above document had some coding errors, which are explained + below: + . + Around line 3062: + Unknown directive: =over4 + . + Around line 3064: + '=item' outside of any '=over' +Origin: vendor +Author: gregor herrmann +Last-Update: 2018-05-07 +Forwarded: https://github.com/libwww-perl/WWW-Mechanize/pull/250 +Bug: https://github.com/libwww-perl/WWW-Mechanize/pull/250 + +--- a/lib/WWW/Mechanize.pm ++++ b/lib/WWW/Mechanize.pm +@@ -3059,7 +3059,7 @@ + The default settings can get you up and running quickly, but there are settings + you can change in order to make your life easier. + +-=over4 ++=over 4 + + =item autocheck + diff -Nru libwww-mechanize-perl-1.86/debian/patches/series libwww-mechanize-perl-1.88/debian/patches/series --- libwww-mechanize-perl-1.86/debian/patches/series 2017-09-24 12:59:13.000000000 +0000 +++ libwww-mechanize-perl-1.88/debian/patches/series 2018-05-07 18:29:48.000000000 +0000 @@ -1,2 +1,2 @@ -html-form-input.patch autopkgtest.patch +pod-syntax.patch diff -Nru libwww-mechanize-perl-1.86/dist.ini libwww-mechanize-perl-1.88/dist.ini --- libwww-mechanize-perl-1.86/dist.ini 2017-07-04 15:48:55.000000000 +0000 +++ libwww-mechanize-perl-1.88/dist.ini 2018-03-23 15:37:36.000000000 +0000 @@ -4,7 +4,6 @@ main_module = lib/WWW/Mechanize.pm copyright_holder = Andy Lester copyright_year = 2004-2016 -version = 1.86 [@Author::OALDERS] -remove = CheckChangesHasContent @@ -15,6 +14,9 @@ -remove = Test::Synopsis -remove = ExtraTests +[ExecDir] +dir = bin + [RunExtraTests] [Prereqs / RuntimeRequires] diff -Nru libwww-mechanize-perl-1.86/INSTALL libwww-mechanize-perl-1.88/INSTALL --- libwww-mechanize-perl-1.86/INSTALL 2017-07-04 15:48:55.000000000 +0000 +++ libwww-mechanize-perl-1.88/INSTALL 2018-03-23 15:37:36.000000000 +0000 @@ -31,13 +31,22 @@ % make install +On Windows platforms, you should use `dmake` or `nmake`, instead of `make`. + If your perl is system-managed, you can create a local::lib in your home directory to install modules to. For details, see the local::lib documentation: https://metacpan.org/pod/local::lib + +The prerequisites of this distribution will also have to be installed manually. The +prerequisites are listed in one of the files: `MYMETA.yml` or `MYMETA.json` generated +by running the manual build process described above. + ## Documentation WWW-Mechanize documentation is available as POD. -You can run perldoc from a shell to read the documentation: +You can run `perldoc` from a shell to read the documentation: % perldoc WWW::Mechanize +For more information on installing Perl modules via CPAN, please see: +https://www.cpan.org/modules/INSTALL.html diff -Nru libwww-mechanize-perl-1.86/lib/WWW/Mechanize/Cookbook.pod libwww-mechanize-perl-1.88/lib/WWW/Mechanize/Cookbook.pod --- libwww-mechanize-perl-1.86/lib/WWW/Mechanize/Cookbook.pod 2017-07-04 15:48:55.000000000 +0000 +++ libwww-mechanize-perl-1.88/lib/WWW/Mechanize/Cookbook.pod 2018-03-23 15:37:36.000000000 +0000 @@ -13,7 +13,7 @@ =head1 VERSION -version 1.86 +version 1.88 =head1 INTRODUCTION diff -Nru libwww-mechanize-perl-1.86/lib/WWW/Mechanize/Examples.pod libwww-mechanize-perl-1.88/lib/WWW/Mechanize/Examples.pod --- libwww-mechanize-perl-1.86/lib/WWW/Mechanize/Examples.pod 2017-07-04 15:48:55.000000000 +0000 +++ libwww-mechanize-perl-1.88/lib/WWW/Mechanize/Examples.pod 2018-03-23 15:37:36.000000000 +0000 @@ -13,7 +13,7 @@ =head1 VERSION -version 1.86 +version 1.88 =head1 SYNOPSIS diff -Nru libwww-mechanize-perl-1.86/lib/WWW/Mechanize/FAQ.pod libwww-mechanize-perl-1.88/lib/WWW/Mechanize/FAQ.pod --- libwww-mechanize-perl-1.86/lib/WWW/Mechanize/FAQ.pod 2017-07-04 15:48:55.000000000 +0000 +++ libwww-mechanize-perl-1.88/lib/WWW/Mechanize/FAQ.pod 2018-03-23 15:37:36.000000000 +0000 @@ -13,7 +13,7 @@ =head1 VERSION -version 1.86 +version 1.88 =head1 How to get help with WWW::Mechanize @@ -22,6 +22,10 @@ =over +=item * StackOverflow L + +=item * #lwp on irc.perl.org + =item * L =item * The libwww-perl mailing list at L @@ -379,12 +383,12 @@ =item 2 Check the URL with C<< $mech->uri() >> to see where you ended up -=item 3 Try debugging with C<< LWP::Debug >>. +=item 3 Try debugging with C<< LWP::ConsoleLogger >>. =back If things are really strange, turn on debugging with -C<< use LWP::Debug qw(+); >> +C<< use LWP::ConsoleLogger::Everywhere; >> Just put this in the main program. This causes LWP to print out a trace of the HTTP traffic between client and server and can be used to figure out what is happening at the protocol level. diff -Nru libwww-mechanize-perl-1.86/lib/WWW/Mechanize/Image.pm libwww-mechanize-perl-1.88/lib/WWW/Mechanize/Image.pm --- libwww-mechanize-perl-1.86/lib/WWW/Mechanize/Image.pm 2017-07-04 15:48:55.000000000 +0000 +++ libwww-mechanize-perl-1.88/lib/WWW/Mechanize/Image.pm 2018-03-23 15:37:36.000000000 +0000 @@ -1,9 +1,10 @@ package WWW::Mechanize::Image; -# vi:et:sw=4 ts=4 -$WWW::Mechanize::Image::VERSION = '1.86'; + use strict; use warnings; +our $VERSION = '1.88'; + #ABSTRACT: Image object for WWW::Mechanize @@ -67,7 +68,7 @@ =head1 VERSION -version 1.86 +version 1.88 =head1 SYNOPSIS diff -Nru libwww-mechanize-perl-1.86/lib/WWW/Mechanize/Link.pm libwww-mechanize-perl-1.88/lib/WWW/Mechanize/Link.pm --- libwww-mechanize-perl-1.86/lib/WWW/Mechanize/Link.pm 2017-07-04 15:48:55.000000000 +0000 +++ libwww-mechanize-perl-1.88/lib/WWW/Mechanize/Link.pm 2018-03-23 15:37:36.000000000 +0000 @@ -1,8 +1,10 @@ package WWW::Mechanize::Link; -$WWW::Mechanize::Link::VERSION = '1.86'; + use strict; use warnings; +our $VERSION = '1.88'; + #ABSTRACT: Link object for WWW::Mechanize @@ -49,8 +51,6 @@ } -# vi:et:sw=4 ts=4 - 1; __END__ @@ -65,7 +65,7 @@ =head1 VERSION -version 1.86 +version 1.88 =head1 SYNOPSIS diff -Nru libwww-mechanize-perl-1.86/lib/WWW/Mechanize.pm libwww-mechanize-perl-1.88/lib/WWW/Mechanize.pm --- libwww-mechanize-perl-1.86/lib/WWW/Mechanize.pm 2017-07-04 15:48:55.000000000 +0000 +++ libwww-mechanize-perl-1.88/lib/WWW/Mechanize.pm 2018-03-23 15:37:36.000000000 +0000 @@ -6,7 +6,7 @@ use strict; use warnings; -our $VERSION = '1.86'; +our $VERSION = '1.88'; use Tie::RefHash; use HTTP::Request 1.30; @@ -73,6 +73,9 @@ return $self; } +# overriding LWP::UA's static method +sub _agent { "WWW-Mechanize/$VERSION" } + my %known_agents = ( 'Windows IE 6' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)', @@ -118,6 +121,22 @@ } +sub post { + my $self = shift; + my $uri = shift; + + $uri = $uri->url if ref($uri) eq 'WWW::Mechanize::Link'; + + $uri = $self->base + ? URI->new_abs( $uri, $self->base ) + : URI->new( $uri ); + + # It appears we are returning a super-class method, + # but it in turn calls the request() method here in Mechanize + return $self->SUPER::post( $uri->as_string, @_ ); +} + + sub put { my $self = shift; my $uri = shift; @@ -596,10 +615,12 @@ my $forms = $self->forms; if ( $forms->[$form-1] ) { $self->{current_form} = $forms->[$form-1]; - return $self->{current_form}; + return wantarray + ? ($self->{current_form}, $form) + : $self->{current_form}; } - return; + return wantarray ? () : undef; } @@ -882,8 +903,8 @@ $index++; } # while - # got self far? Didn't find anything - $self->warn( qq{No checkbox "$name" for value "$value" in form} ); + # got this far? Didn't find anything + $self->die( qq{No checkbox "$name" for value "$value" in form} ); } # tick() @@ -1642,7 +1663,7 @@ =head1 VERSION -version 1.86 +version 1.88 =head1 SYNOPSIS @@ -1653,7 +1674,7 @@ Mech also stores a history of the URLs you've visited, which can be queried and revisited. - use WWW::Mechanize; + use WWW::Mechanize (); my $mech = WWW::Mechanize->new(); $mech->get( $url ); @@ -1742,15 +1763,14 @@ =item * L -The queue for bugs & enhancements in WWW::Mechanize and -Test::WWW::Mechanize. Please note that the queue at L -is no longer maintained. +The queue for bugs & enhancements in WWW::Mechanize. Please note that the +queue at L is no longer maintained. -=item * L +=item * L The CPAN documentation page for Mechanize. -=item * L +=item * L Frequently asked questions. Make sure you read here FIRST. @@ -1924,6 +1944,12 @@ stored in a file instead of the response object, some Mech functions that expect it to be there won't work as expected. Use with caution. +=head2 $mech->post( $uri, content => $content ) + +POSTs I<$content> to $uri. Returns an L object. +I<$uri> can be a well-formed URI string, a L object, or a +L object. + =head2 $mech->put( $uri, content => $content ) PUTs I<$content> to $uri. Returns an L object. @@ -1933,7 +1959,7 @@ =head2 $mech->reload() Acts like the reload button in a browser: repeats the current -request. The history (as per the L method) is not altered. +request. The history (as per the L<< back()|/$mech->back() >> method) is not altered. Returns the L object from the reload, or C if there's no current request. @@ -1954,8 +1980,10 @@ =head2 $mech->history($n) This returns the Ith item in history. The 0th item is the most recent -request and response, which would be acted on by methods like C. -The 1th item is the state you'd return to if you called C. +request and response, which would be acted on by methods like +Cfind_link( ... )" >>>. +The 1th item is the state you'd return to if you called +Cback() >>>. The maximum useful value for C<$n> is C<< $mech->history_count - 1 >>. Requests beyond that bound will return C. @@ -2094,7 +2122,7 @@ =head2 $mech->follow_link(...) Follows a specified link on the page. You specify the match to be -found using the same parms that C> uses. +found using the same parms that Cfind_link( ... )" >>> uses. Here some examples: @@ -2199,8 +2227,7 @@ $mech->find_link( tag_regex => qr/^(a|frame)$/ ); -The tags and attributes looked at are defined below, at -L<< $mech->find_link() : link format >>. +The tags and attributes looked at are defined below. =back @@ -2238,7 +2265,8 @@ =head2 $mech->find_all_links( ... ) Returns all the links on the current page that match the criteria. The -method for specifying link criteria is the same as in C>. +method for specifying link criteria is the same as in +Cfind_link( ... )" >>>. Each of the links returned is a L object. In list context, C returns a list of the links. @@ -2252,6 +2280,7 @@ find_all_inputs() returns an array of all the input controls in the current form whose properties match all of the regexes passed in. The controls returned are all descended from HTML::Form::Input. +See L for details. If no criteria are passed, all inputs will be returned. @@ -2351,7 +2380,8 @@ =head2 $mech->find_all_images( ... ) Returns all the images on the current page that match the criteria. The -method for specifying image criteria is the same as in C>. +method for specifying image criteria is the same as in +Cfind_image()" >>>. Each of the images returned is a L object. In list context, C returns a list of the images. @@ -2374,11 +2404,16 @@ =head2 $mech->form_number($number) Selects the Ith form on the page as the target for subsequent -calls to C> and C>. Also returns the form that was -selected. +calls to Cfield( $name, $value, $number )" >>> +and Cclick( $button [, $x, $y] )" >>>. +Also returns the form that was selected. If it is found, the form is returned as an L object and set internally -for later use with Mech's form methods such as C> and C>. +for later use with Mech's form methods such as +Cfield( $name, $value, $number )" >>> and +Cclick( $button [, $x, $y] )" >>>. +When called in a list context, the number of the found form is also returned as +a second value. Emits a warning and returns undef if no form is found. @@ -2392,7 +2427,8 @@ If it is found, the form is returned as an L object and set internally for later use with Mech's form methods such as -C> and C>. +Cfield( $name, $value, $number )" >>> and +Cclick( $button [, $x, $y] )" >>>. Returns undef if no form is found. @@ -2403,7 +2439,8 @@ If it is found, the form is returned as an L object and set internally for later use with Mech's form methods such as -C> and C>. +Cfield( $name, $value, $number )" >>> and +Cclick( $button [, $x, $y] )" >>>. If no form is found it returns C. This will also trigger a warning, unless C is enabled. @@ -2419,7 +2456,9 @@ and a warning is generated. If it is found, the form is returned as an L object and set internally -for later used with Mech's form methods such as C> and C>. +for later used with Mech's form methods such as +Cfield( $name, $value, $number )" >>> and +Cclick( $button [, $x, $y] )" >>>. Returns undef and emits a warning if no form is found. @@ -2446,7 +2485,9 @@ Using C as value means that the attribute in question may not be present. If it is found, the form is returned as an L object and set internally -for later used with Mech's form methods such as C> and C>. +for later used with Mech's form methods such as +Cfield( $name, $value, $number )" >>> and +Cclick( $button [, $x, $y] )" >>>. Returns undef if no form is found. @@ -2459,9 +2500,10 @@ =head2 $mech->field( $name, \@values, $number ) Given the name of a field, set its value to the value specified. -This applies to the current form (as set by the L or -L method or defaulting to the first form on the -page). +This applies to the current form (as set by the +Cform_name( $name )" >>> or +Cform_number($number)" >>> +method or defaulting to the first form on the page). The optional I<$number> parameter is used to distinguish between two fields with the same name. The fields are numbered from 1. @@ -2485,7 +2527,7 @@ then all previously selected values will be cleared. Returns true on successfully setting the value. On failure, returns -false and calls C<< $self>warn() >> with an error message. +false and calls C<< $self->warn() >> with an error message. =head2 $mech->set_fields( $name => $value ... ) @@ -2631,8 +2673,8 @@ =head2 $mech->submit_form( ... ) This method lets you select a form from the previously fetched page, -fill in its fields, and submit it. It combines the form_number/form_name, -set_fields and click methods into one higher level call. Its arguments +fill in its fields, and submit it. It combines the C/C, +C and C methods into one higher level call. Its arguments are a list of key/value pairs, all of which are optional. =over 4 @@ -2650,28 +2692,34 @@ (calls C> and C>). -If you choose this, the form_number, form_name, form_id and fields options will be ignored. +If you choose C, the C option will be ignored. The +C, C and C options will still be used. An +exception will be thrown unless exactly one form matches all of the provided +criteria. =item * C<< form_number => n >> -Selects the Ith form (calls C>). If this parm is not +Selects the Ith form (calls +Cform_number($number)" >>>. If this parm is not specified, the currently-selected form is used. =item * C<< form_name => name >> -Selects the form named I (calls C>) +Selects the form named I (calls +Cform_name( $name )" >>>) =item * C<< form_id => ID >> -Selects the form with ID I (calls C>) +Selects the form with ID I (calls +Cform_id( $name )" >>>)>>) =item * C<< button => button >> -Clicks on button I