HTML-Form-6.12/0000775000175000017500000000000014704505176011546 5ustar olafolafHTML-Form-6.12/t/0000775000175000017500000000000014704505176012011 5ustar olafolafHTML-Form-6.12/t/form-selector.t0000644000175000017500000000203114704505176014751 0ustar olafolaf#!perl use strict; use warnings; use Test::More tests => 12; use HTML::Form; my $form = HTML::Form->parse( <<"EOT", base => "http://example.com", strict => 1 );
EOT #$form->dump; is( $form->value("n1"), 1 ); is( $form->value("^n1"), 1 ); is( $form->value("#id1"), 1 ); is( $form->value(".A"), 1 ); is( $form->value("#id2"), 2 ); is( $form->value(".B"), 3 ); is( j( map $_->value, $form->find_input(".A") ), "1:2" ); $form->find_input("#id2")->name("n2"); $form->value( "#id2", 22 ); is( $form->click->uri->query, "n1=1&n2=22" ); # try some odd names is( $form->find_input("##foo")->name, "#bar" ); is( $form->find_input("#bar"), undef ); is( $form->find_input("^#bar")->class, ".D" ); is( $form->find_input("..D")->id, "#foo" ); sub j { join( ":", @_ ); } HTML-Form-6.12/t/form-multi-select.t0000644000175000017500000000522114704505176015544 0ustar olafolaf#!/usr/bin/perl # Test for case when multiple forms are on a page with same-named }; return \$html; } ##### package FakeResponse::TwoForms; sub new { bless {}, shift; } sub base { return "http://foo.com"; } sub decoded_content { my $html = qq{
}; return \$html; } HTML-Form-6.12/t/form-parse.t0000644000175000017500000000047514704505176014255 0ustar olafolaf#!perl use strict; use warnings; use Test::More; use HTML::Form (); use Test::Warnings qw(warning); $^W = 1; like( warning { HTML::Form->parse( q{}, base => 'http://localhost/', foo => 1 ) }, qr/^Unrecognized option foo in HTML::Form/, 'caught invalid option to parse()', ); done_testing; HTML-Form-6.12/t/form-param.t0000644000175000017500000000561114704505176014240 0ustar olafolaf#!perl use strict; use warnings; use HTML::Form (); use Test::More; my $form = HTML::Form->parse( <<"EOT", base => "http://example.com", strict => 1 );
EOT is( $form->param, 4, '4 params' ); is( j( $form->param ), "hidden_1:checkbox_1:checkbox_2:multi_select_field", 'param names' ); is( $form->find_input('checkbox_1')->type, 'checkbox', 'checkbox_1 is a checkbox' ); is( $form->param('hidden_1'), '', 'hidden1 empty' ); is( $form->param('checkbox_1'), 'c1_v1', 'checkbox_1' ); is( j( $form->param('checkbox_1') ), 'c1_v1:c1_v2', 'all checkbox_1 values' ); is( $form->param('checkbox_2'), 'c2_v1', 'checkbox_2 value' ); is( j( $form->param('checkbox_2') ), 'c2_v1', 'all checkbox_2 values' ); is( $form->find_input('checkbox_2')->type, 'checkbox', 'checkbox_2 is a checkbox' ); ok( !defined( $form->param('multi_select_field') ), 'no multi-select field value' ); is( j( $form->param('multi_select_field') ), '', 'no multi_select_field values' ); subtest 'unknown' => sub { ok( !defined( $form->param('unknown') ), 'single unknown param' ); is( j( $form->param('unknown') ), '', 'multiple unknown params' ); }; subtest 'exceptions' => sub { eval { $form->param( 'hidden_1', 'x' ); }; like( $@, qr/readonly/, 'error on setting readonly field' ); is( j( $form->param('hidden_1') ), '', 'hidden_1 empty' ); eval { $form->param( 'checkbox_1', 'foo' ); }; like( $@, qr/Illegal value/, 'error on setting illegal value' ); is( j( $form->param('checkbox_1') ), 'c1_v1:c1_v2', 'checkbox_1 was not reset after illegal value' ); }; $form->param( 'checkbox_1', 'c1_v2' ); is( j( $form->param('checkbox_1') ), 'c1_v2', 'checkbox_1 set to single value' ); is( j( $form->param('checkbox_1') ), 'c1_v2', 'checkbox_1 value reset' ); $form->param( 'checkbox_1', [] ); is( j( $form->param('checkbox_1') ), '', 'checkbox_1 empty' ); $form->param( 'checkbox_1', [ 'c1_v2', 'c1_v1' ] ); is( j( $form->param('checkbox_1') ), 'c1_v1:c1_v2', 'multiple checkbox_1 values have been set' ); $form->param( 'checkbox_1', [] ); is( j( $form->param('checkbox_1') ), '', 'checkbox_1 empty again' ); $form->param( 'checkbox_1', 'c1_v2', 'c1_v1' ); is( j( $form->param('checkbox_1') ), 'c1_v1:c1_v2', 'multiple checkbox_1 values again' ); $form->param( 'multi_select_field', 3, 2 ); is( j( $form->param('multi_select_field') ), "2:3", 'multiple multi_select_field values' ); # This should be replaced. We could just be comparing arrays. sub j { join( ":", @_ ); } done_testing(); HTML-Form-6.12/t/form-unicode.t0000644000175000017500000000362114704505176014565 0ustar olafolaf#!perl use strict; use warnings; use Test::More tests => 15; use HTML::Form; my @warn; $SIG{__WARN__} = sub { push( @warn, $_[0] ) }; my $f = HTML::Form->parse( <<'EOT', "http://localhost/" );
EOT is( $f->value("name"), "" ); is( $f->accept_charset, "UNKNOWN" ); my $req = $f->click; is( $req->uri, "http://localhost/abc?name=&latin=" ); $f->value( name => "\x{0424}" ); # capital cyrillic ef $f->value( latin => "\xE5" ); # aring $req = $f->click; is( $req->method, "GET" ); is( $req->uri, "http://localhost/abc?name=%D0%A4&latin=%C3%A5" ); $f->method('POST'); $f->enctype('multipart/form-data'); $req = $f->click; is( $req->uri, "http://localhost/abc" ); is( $req->content, "--xYzZY\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n\xD0\xA4\r\n--xYzZY\r\nContent-Disposition: form-data; name=\"latin\"\r\n\r\n\xC3\xA5\r\n--xYzZY--\r\n" ); $f->accept_charset('koi8-r'); $req = $f->click; is( $req->uri, "http://localhost/abc" ); is( $req->content, "--xYzZY\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n\xE6\r\n--xYzZY\r\nContent-Disposition: form-data; name=\"latin\"\r\n\r\n?\r\n--xYzZY--\r\n" ); $f->method('GET'); $req = $f->click; is( $req->uri, "http://localhost/abc?name=%E6&latin=%3F" ); $f = HTML::Form->parse( <<'EOT', "http://localhost/" );
EOT is( $f->accept_charset, 'koi8-r' ); $f->value( name => "\x{0425}" ); # capital cyrillic kha $req = $f->click; is( $req->method, "GET" ); is( $req->uri, "http://localhost/abc?name=%E8" ); $f->method('POST'); $f->enctype('multipart/form-data'); $req = $f->click; is( $req->uri, "http://localhost/abc" ); is( $req->content, "--xYzZY\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n\xE8\r\n--xYzZY--\r\n" ); HTML-Form-6.12/t/form-label.t0000644000175000017500000000104714704505176014216 0ustar olafolaf#!perl use strict; use warnings; use Test::More tests => 2; use HTML::Form; { my $form = HTML::Form->parse( <<"EOT", base => "http://example.com", strict => 1 );
EOT is( $form->param('tt'), 'test content' ); } { my $form = HTML::Form->parse( <<"EOT", base => "http://example.com", strict => 1 );
EOT is( $form->param('tt'), 'test content' ); } HTML-Form-6.12/t/find_input.t0000644000175000017500000000143214704505176014333 0ustar olafolaf#!/usr/bin/perl use strict; use warnings; use Test::More; use HTML::Form (); use Test::Warnings qw(warning); my $html = '
'; my $form = HTML::Form->parse( $html, 'http://example.com' ); ok( $form, 'form created' ); ok( !eval { $form->find_input( 'submit', 'button', 0 ); 1; }, 'index 0' ); like( $@, qr/Invalid index 0/, 'exception text' ); ok( !eval { $form->find_input( 'submit', 'button', 'a' ); 1; }, 'index a' ); like( $@, qr/Invalid index a/, 'exception text' ); { like( warning { my @inputs = $form->find_input( 'submit', 'input', 1 ); }, qr/^find_input called in list context with index specified/, 'warning text' ); } done_testing; HTML-Form-6.12/t/00-report-prereqs.dd0000644000175000017500000000576514704505176015544 0ustar olafolafdo { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0' }, 'suggests' => { 'JSON::PP' => '2.27300' } }, 'develop' => { 'recommends' => { 'Dist::Zilla::PluginBundle::Git::VersionManager' => '0.007' }, 'requires' => { 'File::Spec' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Pod::Coverage::TrustPod' => '0', 'Pod::Wordlist' => '0', 'Test::EOL' => '0', 'Test::MinimumVersion' => '0', 'Test::Mojibake' => '0', 'Test::More' => '0.94', 'Test::NoTabs' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '1.08', 'Test::Portability::Files' => '0', 'Test::Spelling' => '0.12', 'Test::Version' => '1', 'perl' => '5.006', 'warnings' => '0' } }, 'runtime' => { 'requires' => { 'Carp' => '0', 'Encode' => '2', 'HTML::TokeParser' => '0', 'HTTP::Request' => '6', 'HTTP::Request::Common' => '6.03', 'Test::More' => '0.96', 'URI' => '1.10', 'parent' => '0', 'perl' => '5.008001', 'strict' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'HTTP::Response' => '0', 'Test::More' => '0.96', 'Test::Warnings' => '0', 'warnings' => '0' } } }; $x; }HTML-Form-6.12/t/file_upload.t0000644000175000017500000000672214704505176014466 0ustar olafolafuse strict; use warnings; use Test::More; use HTML::Form; my ( $form, $input ); sub new_form_and_input { $form = HTML::Form->new( 'POST', '/', 'multipart/form-data' ); $form->push_input( 'file', { name => 'document' } ); ($input) = $form->inputs; return $form, $input; } my $file = 't/file_upload.txt'; my $filename = 'the_uploaded_file.txt'; # Using [$file, $filename] as argument # $input->value and array refs ( $form, $input ) = new_form_and_input; $input->value( [ $file, $filename ] ); like( $form->make_request->as_string, qr! filename="$filename" !x, 'Upload: using $input->value([$file, $filename])' ); # $input->file and array refs ( $form, $input ) = new_form_and_input; $input->file( [ $file, $filename ] ); like( $form->make_request->as_string, qr! filename="$filename" !x, 'Upload: using $input->file([$file, $filename])' ); # $form->value and array refs ( $form, $input ) = new_form_and_input; $form->value( 'document', [ $file, $filename ] ); like( $form->make_request->as_string, qr! filename="$filename" !x, q/Upload: using $form->value('document', [$file, $filename])/ ); # Using [$file, $filename, Content => 'inline content'] as argument # $input->value and array refs ( $form, $input ) = new_form_and_input; $input->value( [ $file, $filename, Content => 'inline content' ] ); like( $form->make_request->as_string, qr! filename="$filename" !x, q/Upload: using $input->value([$file, $filename, Content => '?'])/ ); # $input->file and array refs ( $form, $input ) = new_form_and_input; $input->file( [ $file, $filename, Content => 'inline content' ] ); like( $form->make_request->as_string, qr! filename="$filename" !x, q/Upload: using $input->file([$file, $filename, Content => '?'])/ ); # $input->file and array refs and undef ( $form, $input ) = new_form_and_input; $input->file( [ undef, $filename, Content => 'inline content' ] ); like( $form->make_request->as_string, qr! filename="$filename" !x, q/Upload: using $input->file([undef, $filename, Content => '?'])/ ); # $form->value and array refs ( $form, $input ) = new_form_and_input; $form->value( 'document', [ $file, $filename, Content => 'inline content' ] ); like( $form->make_request->as_string, qr! filename="$filename" !x, q/Upload: using $form->value('document', [$file, $filename, Content => '?'])/ ); # Using methods (file, filename, content) directly # 'file' informed directly ( $form, $input ) = new_form_and_input; $input->file($file); like( $form->make_request->as_string, qr! filename="$file" !x, "Upload: 'file' informed directly and used as 'filename'" ); # 'file' and 'filename' informed directly ( $form, $input ) = new_form_and_input; $input->file($file); $input->filename($filename); like( $form->make_request->as_string, qr! filename="$filename" !x, "Upload: 'file' and 'filename' informed directly" ); # 'file', 'filename' and 'content' informed directly ( $form, $input ) = new_form_and_input; $input->file($file); $input->filename($filename); $input->content('inline content'); like( $form->make_request->as_string, qr! filename="$filename" !x, "Upload: 'file', 'filename' and 'content' informed directly" ); # undef, 'filename' and 'content' informed directly ( $form, $input ) = new_form_and_input; $input->filename($filename); $input->content('inline content'); like( $form->make_request->as_string, qr! filename="$filename" !x, "Upload: undef, 'filename' and 'content' informed directly" ); done_testing; HTML-Form-6.12/t/file_upload.txt0000644000175000017500000000003114704505176015025 0ustar olafolafFirst line. Second line. HTML-Form-6.12/t/autocomplete.t0000644000175000017500000000142014704505176014672 0ustar olafolaf#!perl use strict; use warnings; use HTML::Form; use Test::More; my $form = HTML::Form->parse( <<'EOT', "http://localhost/" );
EOT isa_ok( $form, 'HTML::Form' ); { my $input = $form->find_input('#password-field'); is( $input->autocomplete, 'password', 'autocomplete parsed' ); $input->autocomplete('foo'); is( $input->autocomplete, 'foo', 'autocomplete is settable' ); } { my $input = $form->find_input('#login-field'); is( $input->autocomplete, undef, 'autocomplete is undef' ); $input->autocomplete('foo'); is( $input->autocomplete, 'foo', 'autocomplete is settable' ); } done_testing(); HTML-Form-6.12/t/form-maxlength.t0000644000175000017500000000342714704505176015132 0ustar olafolaf#!/usr/bin/perl use strict; use warnings; use Test::More tests => 12; use HTML::Form; my $html = do { local $/ = undef; }; my $form = HTML::Form->parse( $html, 'foo.html' ); isa_ok( $form, 'HTML::Form' ); my $input = $form->find_input('passwd'); isa_ok( $input, 'HTML::Form::TextInput' ); sub set_value { my $input = shift; my $value = shift; my $len = length($value); my $old = $input->value; is( $input->value($value), $old, "set value length=$len" ); is( $input->value, $value, "got value length=$len" ); } { is( $input->{maxlength}, 8, 'got maxlength: 8' ); set_value( $input, '1234' ); set_value( $input, '1234567890' ); ok( !$input->strict, "not strict by default" ); $form->strict(1); ok( $input->strict, "input strict change when form strict change" ); set_value( $input, '1234' ); eval { set_value( $input, '1234567890' ); }; like( $@, qr/^Input 'passwd' has maxlength '8' at /, "Exception raised" ); } __DATA__
Login:
Password
remember me
password reminder
Create A New User
HTML-Form-6.12/t/00-report-prereqs.t0000644000175000017500000001360114704505176015404 0ustar olafolaf#!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.029 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if grep { $_ eq $mod } @exclude; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; if ($mod eq 'perl') { push @reports, ['perl', $want, $]]; next; } my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass('Reported prereqs'); # vim: ts=4 sts=4 sw=4 et: HTML-Form-6.12/t/form.t0000644000175000017500000004034614704505176013146 0ustar olafolaf#!perl use strict; use warnings; use Test::More; use HTML::Form; my @warn; $SIG{__WARN__} = sub { push( @warn, $_[0] ) }; my @f = HTML::Form->parse( "", "http://localhost/" ); is( @f, 0 ); @f = HTML::Form->parse( <<'EOT', "http://localhost/" );
EOT is( @f, 2 ); my $f = shift @f; is( $f->value("name"), "" ); is( $f->dump, "GET http://localhost/abc [foo]\n name= (text)\n" ); my $req = $f->click; is( $req->method, "GET" ); is( $req->uri, "http://localhost/abc?name=" ); $f->value( name => "Gisle Aas" ); $req = $f->click; is( $req->method, "GET" ); is( $req->uri, "http://localhost/abc?name=Gisle+Aas" ); is( $f->attr("name"), "foo" ); is( $f->attr("method"), undef ); $f = shift @f; is( $f->method, "GET" ); is( $f->action, "http://localhost/" ); is( $f->enctype, "application/x-www-form-urlencoded" ); is( $f->dump, "GET http://localhost/\n" ); # try some more advanced inputs $f = HTML::Form->parse( <<'EOT', base => "http://localhost/", verbose => 1 );
EOT #print $f->dump; #print $f->click->as_string; is( $f->click->as_string, <<'EOT'); POST http://localhost/ Content-Length: 86 Content-Type: application/x-www-form-urlencoded i.x=1&i.y=1&c=on&r=b&t=&p=&tel=&date=&h=xyzzy&f=&x=&a=%0D%0Aabc%0D%0A+++&s=bar&m=a&m=b EOT is( @warn, 1 ); like( $warn[0], qr/^Unknown input type 'xyzzy'/ ); @warn = (); $f = HTML::Form->parse( <<'EOT', "http://localhost/" );
EOT #$f->dump; is( $f->click->as_string, <<'EOT'); GET http://localhost/?x=1&y=1&t=1 EOT # test file upload $f = HTML::Form->parse( <<'EOT', "http://localhost/" );
EOT #print $f->dump; #print $f->click->as_string; is( $f->click->as_string, <<'EOT'); POST http://localhost/ Content-Length: 0 Content-Type: multipart/form-data; boundary=none EOT my $filename = sprintf "foo-%08d.txt", $$; die if -e $filename; open my $file, ">", $filename || die; binmode($file); print $file "This is some text\n"; close($file) || die; $f->value( f => $filename ); #print $f->click->as_string; is( $f->click->as_string, <<"EOT"); POST http://localhost/ Content-Length: 139 Content-Type: multipart/form-data; boundary=xYzZY --xYzZY\r Content-Disposition: form-data; name="f"; filename="$filename"\r Content-Type: text/plain\r \r This is some text \r --xYzZY--\r EOT unlink($filename) || warn "Can't unlink '$filename': $!"; is( @warn, 0 ); # Try to parse form HTTP::Response directly { package MyResponse; require HTTP::Response; our @ISA = ('HTTP::Response'); sub base { "http://www.example.com" } } my $response = MyResponse->new( 200, 'OK' ); $response->content("
"); $f = HTML::Form->parse($response); is( $f->click->as_string, <<"EOT"); GET http://www.example.com?x=42 EOT $f = HTML::Form->parse( < I like it! EOT $f->find_input("x")->check; is( $f->click->as_string, <<"EOT"); GET http://www.example.com?x=on EOT $f->value( "x", "off" ); is( $f->click->as_string, <<"EOT"); GET http://www.example.com EOT $f->value( "x", "I like it!" ); is( $f->click->as_string, <<"EOT"); GET http://www.example.com?x=on EOT $f->value( "x", "I LIKE IT!" ); is( $f->click->as_string, <<"EOT"); GET http://www.example.com?x=on EOT $f = HTML::Form->parse( < EOT $f->value( "x", "one" ); is( $f->click->as_string, <<"EOT"); GET http://www.example.com?x=1 EOT $f->value( "x", "TWO" ); is( $f->click->as_string, <<"EOT"); GET http://www.example.com?x=2 EOT is( join( ":", $f->find_input("x")->value_names ), "one:two:3" ); is( join( ":", map $_->name, $f->find_input( undef, "option" ) ), "x:y" ); $f = HTML::Form->parse( < EOT is( $f->value("x"), 1 ); is( $f->value("y"), 2 ); is( $f->value("z"), 3 ); is( $f->click->uri->query, "y=2&z=3" ); my $input = $f->find_input("x"); is( $input->type, "text" ); ok( !$input->readonly ); ok( $input->disabled ); ok( $input->disabled(0) ); ok( !$input->disabled ); is( $f->click->uri->query, "x=1&y=2&z=3" ); $input = $f->find_input("y"); is( $input->type, "text" ); ok( $input->readonly ); ok( !$input->disabled ); $input->value(22); is( $f->click->uri->query, "x=1&y=22&z=3" ); $input->strict(1); eval { $input->value(23); }; like( $@, qr/^Input 'y' is readonly/ ); ok( $input->readonly(0) ); ok( !$input->readonly ); $input->value(222); is( @warn, 0 ); is( $f->click->uri->query, "x=1&y=222&z=3" ); $input = $f->find_input("z"); is( $input->type, "hidden" ); ok( $input->readonly ); ok( !$input->disabled ); $f = HTML::Form->parse( < one one two three one two three EOT #print $f->dump; ok( $f->find_input("r0")->disabled ); ok( !eval { $f->value( "r0", 1 ); } ); like( $@, qr/^The value '1' has been disabled for field 'r0'/ ); ok( $f->find_input("r0")->disabled(0) ); ok( !$f->find_input("r0")->disabled ); is( $f->value( "r0", 1 ), undef ); is( $f->value("r0"), 1 ); ok( !$f->find_input("r1")->disabled ); is( $f->value( "r1", 2 ), undef ); is( $f->value("r1"), 2 ); ok( !eval { $f->value( "r1", 1 ); } ); like( $@, qr/^The value '1' has been disabled for field 'r1'/ ); is( $f->value( "r2", 1 ), undef ); ok( !eval { $f->value( "r2", 2 ); } ); like( $@, qr/^The value '2' has been disabled for field 'r2'/ ); ok( !eval { $f->value( "r2", "two" ); } ); like( $@, qr/^The value 'two' has been disabled for field 'r2'/ ); ok( !$f->find_input("r2")->disabled(1) ); ok( !eval { $f->value( "r2", 1 ); } ); like( $@, qr/^The value '1' has been disabled for field 'r2'/ ); ok( $f->find_input("r2")->disabled(0) ); ok( !$f->find_input("r2")->disabled ); is( $f->value( "r2", 2 ), 1 ); ok( $f->find_input("s0")->disabled ); ok( !$f->find_input("s1")->disabled ); ok( !$f->find_input("s2")->disabled ); ok( $f->find_input("s3")->disabled ); ok( !eval { $f->value( "s1", 1 ); } ); like( $@, qr/^The value '1' has been disabled for field 's1'/ ); ok( $f->find_input("m0")->disabled ); ok( $f->find_input( "m1", undef, 1 )->disabled ); ok( !$f->find_input( "m1", undef, 2 )->disabled ); ok( !$f->find_input( "m1", undef, 3 )->disabled ); ok( !$f->find_input( "m2", undef, 1 )->disabled ); ok( $f->find_input( "m2", undef, 2 )->disabled ); ok( !$f->find_input( "m2", undef, 3 )->disabled ); ok( $f->find_input( "m3", undef, 1 )->disabled ); ok( $f->find_input( "m3", undef, 2 )->disabled ); ok( $f->find_input( "m3", undef, 3 )->disabled ); $f->find_input( "m3", undef, 2 )->disabled(0); ok( !$f->find_input( "m3", undef, 2 )->disabled ); is( $f->find_input( "m3", undef, 2 )->value(2), undef ); is( $f->find_input( "m3", undef, 2 )->value(undef), 2 ); $f->find_input( "m3", undef, 2 )->disabled(1); ok( $f->find_input( "m3", undef, 2 )->disabled ); is( eval { $f->find_input( "m3", undef, 2 )->value(2) }, undef ); like( $@, qr/^The value '2' has been disabled/ ); is( eval { $f->find_input( "m3", undef, 2 )->value(undef) }, undef ); like( $@, qr/^The 'm3' field can't be unchecked/ ); # multiple select with the same name [RT#18993] $f = HTML::Form->parse( < EOT is( join( "|", $f->form ), "bug|hi|bug|mom|nobug|mom" ); # Try a disabled radiobutton: $f = HTML::Form->parse( < EOT is( $f->click->as_string, <<'EOT'); GET http://localhost/?f=b EOT $f = HTML::Form->parse( <
EOT ok( $f->find_input("randomkey") ); is( $f->find_input("randomkey")->challenge, "1234567890" ); is( $f->find_input("randomkey")->keytype, "rsa" ); is( $f->click->as_string, <value( randomkey => "foo" ); is( $f->click->as_string, <parse( < EOT ok($f); ok( $f->find_input("t") ); @f = HTML::Form->parse( < EOT is( @f, 2 ); ok( $f[0]->find_input("s") ); ok( $f[1]->find_input("t") ); $f = HTML::Form->parse( <
Radio Buttons with Labels
EOT is( join( ":", $f->find_input("r0")->value_names ), "zero" ); is( join( ":", $f->find_input("r1")->value_names ), "one" ); is( join( ":", $f->find_input("r2")->value_names ), "two" ); is( join( ":", $f->find_input("r3")->value_names ), "nested" ); is( join( ":", $f->find_input("r4")->value_names ), "before and after" ); $f = HTML::Form->parse( <
    Keep me informed on the progress of this election

The place you are registered to vote:
County or Parish Note 2
EOT is( join( ":", $f->find_input("keep_informed")->value_names ), "off:" ); $f = HTML::Form->parse( < EOT is( join( ":", $f->find_input("test")->possible_values ), "1:2" ); is( join( ":", $f->find_input("test")->other_possible_values ), "2" ); @warn = (); $f = HTML::Form->parse( < EOT is( @warn, 0 ); $f = HTML::Form->parse( < "http://localhost/" );
EOT is( $f->click->as_string, <parse( < "http://localhost/" );
EOT is( $f->click->as_string, <parse( < EOT TODO: { local $TODO = 'input with empty name should not be included'; is( join( "|", $f->form ), "foo|option in named", "options in unnamed selects are ignored" ); } # explicitly selecting an input that has no name my @nameless_inputs = $f->find_input( \undef ); is( scalar @nameless_inputs, 3, 'find_input with ref to undef finds three forms' ); ok( ( !grep { $_->{name} } @nameless_inputs ), '... and none of them has a name' ); ok( !( scalar $f->find_input( \undef ) )->{name}, 'find_input with ref to undef in scalar context' ); TODO: { local $TODO = 'input with empty name should not be included'; is( $f->click->as_string, <<"EOT"); GET http://localhost/target.html?foo=option+in+named EOT } done_testing;HTML-Form-6.12/LICENSE0000644000175000017500000004641614704505176012564 0ustar olafolafThis software is copyright (c) 1998 by Gisle Aas. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 1998 by Gisle Aas. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Perl Artistic License 1.0 --- This software is Copyright (c) 1998 by Gisle Aas. This is free software, licensed under: The Perl Artistic License 1.0 The "Artistic License" Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as uunet.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. You may embed this Package's interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called "undump" or "unexec" methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package. 7. C subroutines (or comparably compiled subroutines in other languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines do not change the language in any way that would cause it to fail the regression tests for the language. 8. Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package. 9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End HTML-Form-6.12/MANIFEST0000644000175000017500000000161714704505176012702 0ustar olafolaf# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.032. Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL cpanfile dist.ini lib/HTML/Form.pm lib/HTML/Form/FileInput.pm lib/HTML/Form/IgnoreInput.pm lib/HTML/Form/ImageInput.pm lib/HTML/Form/Input.pm lib/HTML/Form/KeygenInput.pm lib/HTML/Form/ListInput.pm lib/HTML/Form/SubmitInput.pm lib/HTML/Form/TextInput.pm perltidyrc t/00-report-prereqs.dd t/00-report-prereqs.t t/autocomplete.t t/file_upload.t t/file_upload.txt t/find_input.t t/form-label.t t/form-maxlength.t t/form-multi-select.t t/form-param.t t/form-parse.t t/form-selector.t t/form-unicode.t t/form.t xt/author/00-compile.t xt/author/eol.t xt/author/minimum-version.t xt/author/mojibake.t xt/author/no-tabs.t xt/author/pod-coverage.t xt/author/pod-spell.t xt/author/pod-syntax.t xt/author/portability.t xt/author/test-version.t xt/release/changes_has_content.t HTML-Form-6.12/INSTALL0000644000175000017500000000452614704505176012604 0ustar olafolafThis is the Perl distribution HTML-Form. Installing HTML-Form is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm HTML::Form If it does not have permission to install modules to the current perl, cpanm will automatically set up and install to a local::lib in your home directory. See the local::lib documentation (https://metacpan.org/pod/local::lib) for details on enabling it in your environment. ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan HTML::Form ## Manual installation As a last resort, you can manually install it. If you have not already downloaded the release tarball, you can find the download link on the module's MetaCPAN page: https://metacpan.org/pod/HTML::Form Untar the tarball, install configure prerequisites (see below), then build it: % perl Makefile.PL % make && make test Then install it: % 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. ## Configure Prerequisites This distribution requires other modules to be installed before this distribution's installer can be run. They can be found under the "configure_requires" key of META.yml or the "{prereqs}{configure}{requires}" key of META.json. ## Other Prerequisites This distribution may require additional modules to be installed after running Makefile.PL. Look for prerequisites in the following phases: * to run make, PHASE = build * to use the module code itself, PHASE = runtime * to run tests, PHASE = test They can all be found in the "PHASE_requires" key of MYMETA.yml or the "{prereqs}{PHASE}{requires}" key of MYMETA.json. ## Documentation HTML-Form documentation is available as POD. You can run `perldoc` from a shell to read the documentation: % perldoc HTML::Form For more information on installing Perl modules via CPAN, please see: https://www.cpan.org/modules/INSTALL.html HTML-Form-6.12/perltidyrc0000644000175000017500000000033014704505176013644 0ustar olafolaf--blank-lines-before-packages=0 --iterations=2 --no-outdent-long-comments -b -bar -boc -ci=4 -i=4 -l=78 -nolq -se -wbb="% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x=" HTML-Form-6.12/Makefile.PL0000644000175000017500000000316214704505176013520 0ustar olafolaf# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.032. use strict; use warnings; use 5.008001; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Class that represents an HTML form element", "AUTHOR" => "Gisle Aas ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "HTML-Form", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.008001", "NAME" => "HTML::Form", "PREREQ_PM" => { "Carp" => 0, "Encode" => 2, "HTML::TokeParser" => 0, "HTTP::Request" => 6, "HTTP::Request::Common" => "6.03", "Test::More" => "0.96", "URI" => "1.10", "parent" => 0, "strict" => 0 }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "HTTP::Response" => 0, "Test::More" => "0.96", "Test::Warnings" => 0, "warnings" => 0 }, "VERSION" => "6.12", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Encode" => 2, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "HTML::TokeParser" => 0, "HTTP::Request" => 6, "HTTP::Request::Common" => "6.03", "HTTP::Response" => 0, "Test::More" => "0.96", "Test::Warnings" => 0, "URI" => "1.10", "parent" => 0, "strict" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); HTML-Form-6.12/dist.ini0000644000175000017500000000730214704505176013212 0ustar olafolafname = HTML-Form author = Gisle Aas license = Perl_5 copyright_holder = Gisle Aas copyright_year = 1998 [Git::GatherDir] exclude_filename = cpanfile exclude_filename = LICENSE exclude_filename = Makefile.PL exclude_filename = META.json exclude_filename = README.md [MetaConfig] [MetaProvides::Package] [MetaNoIndex] directory = t directory = xt [MetaYAML] [MetaJSON] [MetaResources] x_IRC = irc://irc.perl.org/#lwp x_MailingList = mailto:libwww@perl.org [Git::Contributors] [GithubMeta] issues = 1 user = libwww-perl [Manifest] [License] [InstallGuide] ; make the bin dir executables [ExecDir] ; [ShareDir] [Prereqs] Encode = 2 HTTP::Request = 6 HTTP::Request::Common = 6.03 perl = 5.008001 Test::More = 0.96 URI = 1.10 [AutoPrereqs] [CPANFile] [MakeMaker] ; TODO strict and warnings to quiet the kwalitee tests ; [Test::Kwalitee] ; filename = xt/author/kwalitee.t [MojibakeTests] [Test::Version] [Test::ReportPrereqs] [Test::Compile] bail_out_on_fail = 1 xt_mode = 1 ; avoid failing on 5.8: Warning: Use of "keys" without parentheses is ambiguous at Data/Dump/Trace.pm line 262. [Substitute / 00-compile.t] file = xt/author/00-compile.t code = s{(is\(scalar\(\@warnings\), 0, 'no warnings found'\))}{TODO: \{\nlocal \$TODO = 'Data::Dump::Trace warns on 5.8' if \$\] < '5.009';\n$1}; code = s{(^\s+or diag 'got warnings: ', explain\(\\\@warnings\);)}{$1\n\}}; [Test::Portability] ; TODO perltidy for NoTabs and namespace::autoclean ; [Test::CleanNamespaces] ; TODO [Test::NoTabs] [Test::EOL] ; We run release tests in github actions. but make the changes-has-content test TODO only for master. ; This will prod pull request submitters to add a Changes entry. [Test::ChangesHasContent] [Substitute / changes_has_content.t] file = xt/release/changes_has_content.t code = s{^(note 'Checking Changes')}{if \(\(\$ENV\{TRAVIS_PULL_REQUEST\} \|\| '') eq 'false'\) \{\n chomp\(my \$branch_name = \(\$ENV\{TRAVIS_BRANCH\} || \`git rev-parse --abbrev-ref HEAD\`\)\);\n \$TODO = 'Changes need not have content for this release yet if this is only the master branch'\n if \(\$branch_name \|\| ''\) eq 'master';\n\}\n\n$1} [Test::MinimumVersion] [PodSyntaxTests] ; Not 100% clear why file_exts() is undocumented. Maybe meant to be private. [Test::Pod::Coverage::Configurable] trustme = HTML::Form => qr/^(?:fixup|new|push_input|uri)$/ skip = HTML::Form::Input skip = HTML::Form::TextInput skip = HTML::Form::IgnoreInput skip = HTML::Form::ListInput skip = HTML::Form::SubmitInput skip = HTML::Form::ImageInput skip = HTML::Form::FileInput skip = HTML::Form::KeygenInput [Test::PodSpelling] wordlist = Pod::Wordlist spell_cmd = aspell --master=en_US list stopword = autocomplete stopword = CGI stopword = checkbox stopword = readonly stopword = unsetting stopword = unvisited stopword = keygen [Git::Check] allow_dirty = [CheckStrictVersion] decimal_only = 1 [RunExtraTests] [PodWeaver] [CheckChangeLog] [CheckChangesHasContent] [TestRelease] [UploadToCPAN] ; Create Readme [ReadmeAnyFromPod / Markdown_Readme] type = markdown filename = README.md location = root phase = release [CopyFilesFromRelease] filename = cpanfile filename = LICENSE filename = Makefile.PL filename = META.json ; The distribution version is read from lib/LWP.pm's $VERSION. ; At release, all versions are bumped. ; To change the version at release time, you can either edit LWP.pm's ; $VERSION, or set the V environment variable, e.g. V=1.23 dzil release [@Git::VersionManager] commit_files_after_release = cpanfile commit_files_after_release = META.json commit_files_after_release = LICENSE commit_files_after_release = README.md [Git::Push] ; listed late, to allow all other plugins which do BeforeRelease checks to run first. [ConfirmRelease] HTML-Form-6.12/cpanfile0000644000175000017500000000312214704505176013246 0ustar olafolaf# This file is generated by Dist::Zilla::Plugin::CPANFile v6.032 # Do not edit this file directly. To change prereqs, edit the `dist.ini` file. requires "Carp" => "0"; requires "Encode" => "2"; requires "HTML::TokeParser" => "0"; requires "HTTP::Request" => "6"; requires "HTTP::Request::Common" => "6.03"; requires "Test::More" => "0.96"; requires "URI" => "1.10"; requires "parent" => "0"; requires "perl" => "5.008001"; requires "strict" => "0"; on 'test' => sub { requires "ExtUtils::MakeMaker" => "0"; requires "File::Spec" => "0"; requires "HTTP::Response" => "0"; requires "Test::More" => "0.96"; requires "Test::Warnings" => "0"; requires "warnings" => "0"; }; on 'test' => sub { recommends "CPAN::Meta" => "2.120900"; }; on 'configure' => sub { requires "ExtUtils::MakeMaker" => "0"; }; on 'configure' => sub { suggests "JSON::PP" => "2.27300"; }; on 'develop' => sub { requires "File::Spec" => "0"; requires "IO::Handle" => "0"; requires "IPC::Open3" => "0"; requires "Pod::Coverage::TrustPod" => "0"; requires "Pod::Wordlist" => "0"; requires "Test::EOL" => "0"; requires "Test::MinimumVersion" => "0"; requires "Test::Mojibake" => "0"; requires "Test::More" => "0.94"; requires "Test::NoTabs" => "0"; requires "Test::Pod" => "1.41"; requires "Test::Pod::Coverage" => "1.08"; requires "Test::Portability::Files" => "0"; requires "Test::Spelling" => "0.12"; requires "Test::Version" => "1"; requires "perl" => "5.006"; requires "warnings" => "0"; }; on 'develop' => sub { recommends "Dist::Zilla::PluginBundle::Git::VersionManager" => "0.007"; }; HTML-Form-6.12/META.json0000644000175000017500000007325214704505176013176 0ustar olafolaf{ "abstract" : "Class that represents an HTML form element", "author" : [ "Gisle Aas " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.032, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "HTML-Form", "no_index" : { "directory" : [ "t", "xt" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" }, "suggests" : { "JSON::PP" : "2.27300" } }, "develop" : { "recommends" : { "Dist::Zilla::PluginBundle::Git::VersionManager" : "0.007" }, "requires" : { "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Pod::Coverage::TrustPod" : "0", "Pod::Wordlist" : "0", "Test::EOL" : "0", "Test::MinimumVersion" : "0", "Test::Mojibake" : "0", "Test::More" : "0.94", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Portability::Files" : "0", "Test::Spelling" : "0.12", "Test::Version" : "1", "perl" : "5.006", "warnings" : "0" } }, "runtime" : { "requires" : { "Carp" : "0", "Encode" : "2", "HTML::TokeParser" : "0", "HTTP::Request" : "6", "HTTP::Request::Common" : "6.03", "Test::More" : "0.96", "URI" : "1.10", "parent" : "0", "perl" : "5.008001", "strict" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "HTTP::Response" : "0", "Test::More" : "0.96", "Test::Warnings" : "0", "warnings" : "0" } } }, "provides" : { "HTML::Form" : { "file" : "lib/HTML/Form.pm", "version" : "6.12" }, "HTML::Form::FileInput" : { "file" : "lib/HTML/Form/FileInput.pm", "version" : "6.12" }, "HTML::Form::IgnoreInput" : { "file" : "lib/HTML/Form/IgnoreInput.pm", "version" : "6.12" }, "HTML::Form::ImageInput" : { "file" : "lib/HTML/Form/ImageInput.pm", "version" : "6.12" }, "HTML::Form::Input" : { "file" : "lib/HTML/Form/Input.pm", "version" : "6.12" }, "HTML::Form::KeygenInput" : { "file" : "lib/HTML/Form/KeygenInput.pm", "version" : "6.12" }, "HTML::Form::ListInput" : { "file" : "lib/HTML/Form/ListInput.pm", "version" : "6.12" }, "HTML::Form::SubmitInput" : { "file" : "lib/HTML/Form/SubmitInput.pm", "version" : "6.12" }, "HTML::Form::TextInput" : { "file" : "lib/HTML/Form/TextInput.pm", "version" : "6.12" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/libwww-perl/HTML-Form/issues" }, "homepage" : "https://github.com/libwww-perl/HTML-Form", "repository" : { "type" : "git", "url" : "https://github.com/libwww-perl/HTML-Form.git", "web" : "https://github.com/libwww-perl/HTML-Form" }, "x_IRC" : "irc://irc.perl.org/#lwp", "x_MailingList" : "mailto:libwww@perl.org" }, "version" : "6.12", "x_Dist_Zilla" : { "perl" : { "version" : "5.034000" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [ "LICENSE", "META.json", "Makefile.PL", "README.md", "cpanfile" ], "exclude_match" : [], "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." }, "Dist::Zilla::Plugin::Git::GatherDir" : { "include_untracked" : 0 } }, "name" : "Git::GatherDir", "version" : "2.051" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "MetaConfig", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : { "finder_objects" : [ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "6.032" } ], "include_underscores" : 0 }, "Dist::Zilla::Role::MetaProvider::Provider" : { "$Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.002004", "inherit_missing" : 1, "inherit_version" : 1, "meta_noindex" : 1 }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000037", "version" : "0.006" } }, "name" : "MetaProvides::Package", "version" : "2.004003" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "MetaNoIndex", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "MetaYAML", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "MetaJSON", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "MetaResources", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "git_version" : "2.34.1", "include_authors" : 0, "include_releaser" : 1, "order_by" : "name", "paths" : [] } }, "name" : "Git::Contributors", "version" : "0.037" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "GithubMeta", "version" : "0.58" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "Manifest", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "License", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::InstallGuide", "config" : { "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000037", "version" : "0.006" } }, "name" : "InstallGuide", "version" : "1.200014" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "ExecDir", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "requires" } }, "name" : "Prereqs", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "AutoPrereqs", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::CPANFile", "name" : "CPANFile", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : "8" } }, "name" : "MakeMaker", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::MojibakeTests", "name" : "MojibakeTests", "version" : "0.8" }, { "class" : "Dist::Zilla::Plugin::Test::Version", "name" : "Test::Version", "version" : "1.09" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "Test::ReportPrereqs", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : "1", "fail_on_warning" : "author", "fake_home" : 0, "filename" : "xt/author/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "develop", "script_finder" : [ ":PerlExecFiles" ], "skips" : [], "switch" : [] } }, "name" : "Test::Compile", "version" : "2.058" }, { "class" : "Dist::Zilla::Plugin::Substitute", "name" : "00-compile.t", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::Test::Portability", "config" : { "Dist::Zilla::Plugin::Test::Portability" : { "options" : "" } }, "name" : "Test::Portability", "version" : "2.001001" }, { "class" : "Dist::Zilla::Plugin::Test::NoTabs", "config" : { "Dist::Zilla::Plugin::Test::NoTabs" : { "filename" : "xt/author/no-tabs.t", "finder" : [ ":InstallModules", ":ExecFiles", ":TestFiles" ] } }, "name" : "Test::NoTabs", "version" : "0.15" }, { "class" : "Dist::Zilla::Plugin::Test::EOL", "config" : { "Dist::Zilla::Plugin::Test::EOL" : { "filename" : "xt/author/eol.t", "finder" : [ ":ExecFiles", ":InstallModules", ":TestFiles" ], "trailing_whitespace" : 1 } }, "name" : "Test::EOL", "version" : "0.19" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "Test::ChangesHasContent", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::Substitute", "name" : "changes_has_content.t", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::Test::MinimumVersion", "config" : { "Dist::Zilla::Plugin::Test::MinimumVersion" : { "max_target_perl" : null } }, "name" : "Test::MinimumVersion", "version" : "2.000010" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "PodSyntaxTests", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::Test::Pod::Coverage::Configurable", "name" : "Test::Pod::Coverage::Configurable", "version" : "0.07" }, { "class" : "Dist::Zilla::Plugin::Test::PodSpelling", "config" : { "Dist::Zilla::Plugin::Test::PodSpelling" : { "directories" : [ "bin", "lib" ], "spell_cmd" : "aspell --master=en_US list", "stopwords" : [ "CGI", "autocomplete", "checkbox", "keygen", "readonly", "unsetting", "unvisited" ], "wordlist" : "Pod::Wordlist" } }, "name" : "Test::PodSpelling", "version" : "2.007005" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.34.1", "repo_root" : "." } }, "name" : "Git::Check", "version" : "2.051" }, { "class" : "Dist::Zilla::Plugin::CheckStrictVersion", "name" : "CheckStrictVersion", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : "8" } }, "name" : "RunExtraTests", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "finder" : [ ":InstallModules", ":PerlExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.019" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.019" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@Default/SingleEncoding", "version" : "4.019" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@Default/Name", "version" : "4.019" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@Default/Version", "version" : "4.019" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Default/prelude", "version" : "4.019" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "SYNOPSIS", "version" : "4.019" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "DESCRIPTION", "version" : "4.019" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "OVERVIEW", "version" : "4.019" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "ATTRIBUTES", "version" : "4.019" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "METHODS", "version" : "4.019" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "FUNCTIONS", "version" : "4.019" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@Default/Leftovers", "version" : "4.019" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Default/postlude", "version" : "4.019" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@Default/Authors", "version" : "4.019" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@Default/Legal", "version" : "4.019" } ] } }, "name" : "PodWeaver", "version" : "4.010" }, { "class" : "Dist::Zilla::Plugin::CheckChangeLog", "name" : "CheckChangeLog", "version" : "0.05" }, { "class" : "Dist::Zilla::Plugin::CheckChangesHasContent", "name" : "CheckChangesHasContent", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "TestRelease", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "UploadToCPAN", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "Markdown_Readme", "version" : "0.163250" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "LICENSE", "META.json", "Makefile.PL", "cpanfile" ], "match" : [] } }, "name" : "CopyFilesFromRelease", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "recommends" } }, "name" : "@Git::VersionManager/pluginbundle version", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::RewriteVersion::Transitional", "config" : { "Dist::Zilla::Plugin::RewriteVersion" : { "add_tarball_name" : 0, "finders" : [ ":ExecFiles", ":InstallModules" ], "global" : 0, "skip_version_provider" : 0 }, "Dist::Zilla::Plugin::RewriteVersion::Transitional" : {} }, "name" : "@Git::VersionManager/RewriteVersion::Transitional", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Update", "name" : "@Git::VersionManager/MetaProvides::Update", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "Changes" ], "match" : [] } }, "name" : "@Git::VersionManager/CopyFilesFromRelease", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "v%V%n%n%c", "signoff" : 0 }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "LICENSE", "META.json", "README.md", "cpanfile" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.34.1", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Git::VersionManager/release snapshot", "version" : "2.051" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "v6.12", "tag_format" : "v%V", "tag_message" : "v%V" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.34.1", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Git::VersionManager/Git::Tag", "version" : "2.051" }, { "class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional", "config" : { "Dist::Zilla::Plugin::BumpVersionAfterRelease" : { "finders" : [ ":ExecFiles", ":InstallModules" ], "global" : 0, "munge_makefile_pl" : 1 }, "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : {} }, "name" : "@Git::VersionManager/BumpVersionAfterRelease::Transitional", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@Git::VersionManager/NextRelease", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "increment $VERSION after %v release", "signoff" : 0 }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Build.PL", "Changes", "Makefile.PL" ], "allow_dirty_match" : [ "(?^:^lib/.*\\.pm$)" ], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.34.1", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Git::VersionManager/post-release commit", "version" : "2.051" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin" ], "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.34.1", "repo_root" : "." } }, "name" : "Git::Push", "version" : "2.051" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "ConfirmRelease", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.032" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "6.032" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.032" } }, "x_contributors" : [ "Adam Kennedy ", "Adam Sjogren ", "Alessandro Ghedini ", "Alexandr Ciornii ", "Alexey Tourbin ", "Alex Kapranoff ", "amire80 ", "Andreas J. Koenig ", "Bill Mann ", "Bron Gondwana ", "Daniel Hedlund ", "David E. Wheeler ", "DAVIDRW ", "David Steinbrunner ", "E. Choroba ", "Father Chrysostomos ", "Felix Ostmann ", "FWILES ", "Gavin Peters ", "Gil Magno ", "Gisle Aas ", "Gisle Aas ", "Gisle Aas ", "Gisle Aas ", "Graeme Thompson ", "Graham Knop ", "Hans-H. Froehlich ", "Ian Kilgore ", "Jacob J ", "James Raspass ", "jefflee ", "john9art ", "Julien Fiegehenn ", "Lance Wicks ", "Lukas Mai ", "Mark Stosberg ", "Mark Stosberg ", "Mark Stosberg ", "Mike Schilli ", "Mohammad S Anwar ", "mschilli ", "murphy ", "Olaf Alders ", "Ondrej Hanak ", "Peter Rabbitson ", "phrstbrn ", "Robert Stone ", "Rolf Grossmann ", "ruff ", "sasao ", "Sean M. Burke ", "Slaven Rezic ", "Slaven Rezic ", "Spiros Denaxas ", "Steve Hay ", "Todd Lipcon ", "Tom Hukins ", "Tony Finch ", "Toru Yamaguchi ", "uid39246 ", "Ville Skytt\u00e4 ", "Yuri Karaban ", "Zefram " ], "x_generated_by_perl" : "v5.34.0", "x_serialization_backend" : "Cpanel::JSON::XS version 4.38", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later" } HTML-Form-6.12/xt/0000775000175000017500000000000014704505176012201 5ustar olafolafHTML-Form-6.12/xt/author/0000775000175000017500000000000014704505176013503 5ustar olafolafHTML-Form-6.12/xt/author/portability.t0000644000175000017500000000013014704505176016222 0ustar olafolafuse strict; use warnings; use Test::More; use Test::Portability::Files; run_tests(); HTML-Form-6.12/xt/author/minimum-version.t0000644000175000017500000000015414704505176017024 0ustar olafolafuse strict; use warnings; use Test::More; use Test::MinimumVersion; all_minimum_version_from_metayml_ok(); HTML-Form-6.12/xt/author/00-compile.t0000644000175000017500000000324014704505176015532 0ustar olafolafuse 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058 use Test::More 0.94; plan tests => 10; my @module_files = ( 'HTML/Form.pm', 'HTML/Form/FileInput.pm', 'HTML/Form/IgnoreInput.pm', 'HTML/Form/ImageInput.pm', 'HTML/Form/Input.pm', 'HTML/Form/KeygenInput.pm', 'HTML/Form/ListInput.pm', 'HTML/Form/SubmitInput.pm', 'HTML/Form/TextInput.pm' ); # no fake home requested my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { +require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } TODO: { local $TODO = 'Data::Dump::Trace warns on 5.8' if $] < '5.009'; is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', explain(\@warnings); } BAIL_OUT("Compilation problems") if !Test::More->builder->is_passing; HTML-Form-6.12/xt/author/pod-coverage.t0000644000175000017500000000241614704505176016244 0ustar olafolaf#!perl # This file was automatically generated by Dist::Zilla::Plugin::Test::Pod::Coverage::Configurable 0.07. use Test::Pod::Coverage 1.08; use Test::More 0.88; BEGIN { if ( $] <= 5.008008 ) { plan skip_all => 'These tests require Pod::Coverage::TrustPod, which only works with Perl 5.8.9+'; } } use Pod::Coverage::TrustPod; my %skip = map { $_ => 1 } qw( HTML::Form::Input HTML::Form::TextInput HTML::Form::IgnoreInput HTML::Form::ListInput HTML::Form::SubmitInput HTML::Form::ImageInput HTML::Form::FileInput HTML::Form::KeygenInput ); my @modules; for my $module ( all_modules() ) { next if $skip{$module}; push @modules, $module; } plan skip_all => 'All the modules we found were excluded from POD coverage test.' unless @modules; plan tests => scalar @modules; my %trustme = ( 'HTML::Form' => [ qr/^(?:fixup|new|push_input|uri)$/ ] ); my @also_private; for my $module ( sort @modules ) { pod_coverage_ok( $module, { coverage_class => 'Pod::Coverage::TrustPod', also_private => \@also_private, trustme => $trustme{$module} || [], }, "pod coverage for $module" ); } done_testing(); HTML-Form-6.12/xt/author/pod-spell.t0000644000175000017500000000265514704505176015575 0ustar olafolafuse strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007005 use Test::Spelling 0.12; use Pod::Wordlist; set_spell_cmd('aspell --master=en_US list'); add_stopwords(); all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ Aas Adam Alders Alessandro Alex Alexandr Alexey Andreas Anwar Bill Bron Burke CGI Choroba Chrysostomos Ciornii DAVIDRW Daniel David Denaxas FWILES Father Felix Fiegehenn FileInput Finch Form Froehlich Gavin Ghedini Gil Gisle Gondwana Graeme Graham Grossmann HTML Hanak Hans Hay Hedlund Hukins Ian IgnoreInput ImageInput Input Jacob James Julien Kapranoff Karaban Kennedy KeygenInput Kilgore Knop Koenig Lance Lipcon ListInput Lukas MARKSTOS Magno Mai Mann Mark Mike Mohammad Olaf Ondrej Ostmann Peter Peters Rabbitson Raspass Rezic Robert Rolf Schilli Sean Sjogren Skyttä Slaven Spiros Steinbrunner Steve SteveHay Stone Stosberg SubmitInput TextInput Thompson Todd Tom Tony Toru Tourbin Ville Wheeler Wicks Yamaguchi Yuri Zefram aas adamk al3xbio alexchorny amir amire80 andreas asjo at autocomplete brong checkbox choroba david davidrw denaxas dot dsteinbrunner felix gilmagno gisle github gpeters haarg hfroehlich iank jefflee john9art jraspass ka keygen lib lw mai mark mohammad mschilli murphy olaf ondrej phrstbrn readonly rg ribasushi ruff sasao sburke shaohua simbabque slaven sprout srezic talby tech todd tom uid39246 unsetting unvisited ville waif wfmann zefram zigorou HTML-Form-6.12/xt/author/no-tabs.t0000644000175000017500000000150514704505176015232 0ustar olafolafuse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15 use Test::More 0.88; use Test::NoTabs; my @files = ( 'lib/HTML/Form.pm', 'lib/HTML/Form/FileInput.pm', 'lib/HTML/Form/IgnoreInput.pm', 'lib/HTML/Form/ImageInput.pm', 'lib/HTML/Form/Input.pm', 'lib/HTML/Form/KeygenInput.pm', 'lib/HTML/Form/ListInput.pm', 'lib/HTML/Form/SubmitInput.pm', 'lib/HTML/Form/TextInput.pm', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/autocomplete.t', 't/file_upload.t', 't/file_upload.txt', 't/find_input.t', 't/form-label.t', 't/form-maxlength.t', 't/form-multi-select.t', 't/form-param.t', 't/form-parse.t', 't/form-selector.t', 't/form-unicode.t', 't/form.t' ); notabs_ok($_) foreach @files; done_testing; HTML-Form-6.12/xt/author/pod-syntax.t0000644000175000017500000000025214704505176015773 0ustar olafolaf#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); HTML-Form-6.12/xt/author/mojibake.t0000644000175000017500000000015114704505176015444 0ustar olafolaf#!perl use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); HTML-Form-6.12/xt/author/test-version.t0000644000175000017500000000063714704505176016336 0ustar olafolafuse strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 1.09 use Test::Version; my @imports = qw( version_all_ok ); my $params = { is_strict => 0, has_version => 1, multiple => 0, }; push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); Test::Version->import(@imports); version_all_ok; done_testing; HTML-Form-6.12/xt/author/eol.t0000644000175000017500000000153714704505176014453 0ustar olafolafuse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19 use Test::More 0.88; use Test::EOL; my @files = ( 'lib/HTML/Form.pm', 'lib/HTML/Form/FileInput.pm', 'lib/HTML/Form/IgnoreInput.pm', 'lib/HTML/Form/ImageInput.pm', 'lib/HTML/Form/Input.pm', 'lib/HTML/Form/KeygenInput.pm', 'lib/HTML/Form/ListInput.pm', 'lib/HTML/Form/SubmitInput.pm', 'lib/HTML/Form/TextInput.pm', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/autocomplete.t', 't/file_upload.t', 't/file_upload.txt', 't/find_input.t', 't/form-label.t', 't/form-maxlength.t', 't/form-multi-select.t', 't/form-param.t', 't/form-parse.t', 't/form-selector.t', 't/form-unicode.t', 't/form.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; HTML-Form-6.12/xt/release/0000775000175000017500000000000014704505176013621 5ustar olafolafHTML-Form-6.12/xt/release/changes_has_content.t0000644000175000017500000000253014704505176020001 0ustar olafolafuse Test::More tests => 2; if (($ENV{TRAVIS_PULL_REQUEST} || '') eq 'false') { chomp(my $branch_name = ($ENV{TRAVIS_BRANCH} || `git rev-parse --abbrev-ref HEAD`)); $TODO = 'Changes need not have content for this release yet if this is only the master branch' if ($branch_name || '') eq 'master'; } note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '6.12'; my $trial_token = '-TRIAL'; my $encoding = 'UTF-8'; SKIP: { ok(-e $changes_file, "$changes_file file exists") or skip 'Changes is missing', 1; ok(_get_changes($newver), "$changes_file has content for $newver"); } done_testing; sub _get_changes { my $newver = shift; # parse changelog to find commit message open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; my $changelog = join('', <$fh>); if ($encoding) { require Encode; $changelog = Encode::decode($encoding, $changelog, Encode::FB_CROAK()); } close $fh; my @content = grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented split /\n/, $changelog; shift @content; # drop the version line # drop unindented last line and trailing blank lines pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); # return number of non-blank lines return scalar @content; } HTML-Form-6.12/META.yml0000644000175000017500000004641214704505176013024 0ustar olafolaf--- abstract: 'Class that represents an HTML form element' author: - 'Gisle Aas ' build_requires: ExtUtils::MakeMaker: '0' File::Spec: '0' HTTP::Response: '0' Test::More: '0.96' Test::Warnings: '0' warnings: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.032, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: HTML-Form no_index: directory: - t - xt provides: HTML::Form: file: lib/HTML/Form.pm version: '6.12' HTML::Form::FileInput: file: lib/HTML/Form/FileInput.pm version: '6.12' HTML::Form::IgnoreInput: file: lib/HTML/Form/IgnoreInput.pm version: '6.12' HTML::Form::ImageInput: file: lib/HTML/Form/ImageInput.pm version: '6.12' HTML::Form::Input: file: lib/HTML/Form/Input.pm version: '6.12' HTML::Form::KeygenInput: file: lib/HTML/Form/KeygenInput.pm version: '6.12' HTML::Form::ListInput: file: lib/HTML/Form/ListInput.pm version: '6.12' HTML::Form::SubmitInput: file: lib/HTML/Form/SubmitInput.pm version: '6.12' HTML::Form::TextInput: file: lib/HTML/Form/TextInput.pm version: '6.12' requires: Carp: '0' Encode: '2' HTML::TokeParser: '0' HTTP::Request: '6' HTTP::Request::Common: '6.03' Test::More: '0.96' URI: '1.10' parent: '0' perl: '5.008001' strict: '0' resources: IRC: irc://irc.perl.org/#lwp MailingList: mailto:libwww@perl.org bugtracker: https://github.com/libwww-perl/HTML-Form/issues homepage: https://github.com/libwww-perl/HTML-Form repository: https://github.com/libwww-perl/HTML-Form.git version: '6.12' x_Dist_Zilla: perl: version: '5.034000' plugins: - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: - LICENSE - META.json - Makefile.PL - README.md - cpanfile exclude_match: [] include_dotfiles: 0 prefix: '' prune_directory: [] root: . Dist::Zilla::Plugin::Git::GatherDir: include_untracked: 0 name: Git::GatherDir version: '2.051' - class: Dist::Zilla::Plugin::MetaConfig name: MetaConfig version: '6.032' - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: finder_objects: - class: Dist::Zilla::Plugin::FinderCode name: MetaProvides::Package/AUTOVIV/:InstallModulesPM version: '6.032' include_underscores: 0 Dist::Zilla::Role::MetaProvider::Provider: $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004' inherit_missing: '1' inherit_version: '1' meta_noindex: '1' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000037' version: '0.006' name: MetaProvides::Package version: '2.004003' - class: Dist::Zilla::Plugin::MetaNoIndex name: MetaNoIndex version: '6.032' - class: Dist::Zilla::Plugin::MetaYAML name: MetaYAML version: '6.032' - class: Dist::Zilla::Plugin::MetaJSON name: MetaJSON version: '6.032' - class: Dist::Zilla::Plugin::MetaResources name: MetaResources version: '6.032' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: git_version: 2.34.1 include_authors: 0 include_releaser: 1 order_by: name paths: [] name: Git::Contributors version: '0.037' - class: Dist::Zilla::Plugin::GithubMeta name: GithubMeta version: '0.58' - class: Dist::Zilla::Plugin::Manifest name: Manifest version: '6.032' - class: Dist::Zilla::Plugin::License name: License version: '6.032' - class: Dist::Zilla::Plugin::InstallGuide config: Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000037' version: '0.006' name: InstallGuide version: '1.200014' - class: Dist::Zilla::Plugin::ExecDir name: ExecDir version: '6.032' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: requires name: Prereqs version: '6.032' - class: Dist::Zilla::Plugin::AutoPrereqs name: AutoPrereqs version: '6.032' - class: Dist::Zilla::Plugin::CPANFile name: CPANFile version: '6.032' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: '8' name: MakeMaker version: '6.032' - class: Dist::Zilla::Plugin::MojibakeTests name: MojibakeTests version: '0.8' - class: Dist::Zilla::Plugin::Test::Version name: Test::Version version: '1.09' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: Test::ReportPrereqs version: '0.029' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: '1' fail_on_warning: author fake_home: 0 filename: xt/author/00-compile.t module_finder: - ':InstallModules' needs_display: 0 phase: develop script_finder: - ':PerlExecFiles' skips: [] switch: [] name: Test::Compile version: '2.058' - class: Dist::Zilla::Plugin::Substitute name: 00-compile.t version: '0.007' - class: Dist::Zilla::Plugin::Test::Portability config: Dist::Zilla::Plugin::Test::Portability: options: '' name: Test::Portability version: '2.001001' - class: Dist::Zilla::Plugin::Test::NoTabs config: Dist::Zilla::Plugin::Test::NoTabs: filename: xt/author/no-tabs.t finder: - ':InstallModules' - ':ExecFiles' - ':TestFiles' name: Test::NoTabs version: '0.15' - class: Dist::Zilla::Plugin::Test::EOL config: Dist::Zilla::Plugin::Test::EOL: filename: xt/author/eol.t finder: - ':ExecFiles' - ':InstallModules' - ':TestFiles' trailing_whitespace: 1 name: Test::EOL version: '0.19' - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: Test::ChangesHasContent version: '0.011' - class: Dist::Zilla::Plugin::Substitute name: changes_has_content.t version: '0.007' - class: Dist::Zilla::Plugin::Test::MinimumVersion config: Dist::Zilla::Plugin::Test::MinimumVersion: max_target_perl: ~ name: Test::MinimumVersion version: '2.000010' - class: Dist::Zilla::Plugin::PodSyntaxTests name: PodSyntaxTests version: '6.032' - class: Dist::Zilla::Plugin::Test::Pod::Coverage::Configurable name: Test::Pod::Coverage::Configurable version: '0.07' - class: Dist::Zilla::Plugin::Test::PodSpelling config: Dist::Zilla::Plugin::Test::PodSpelling: directories: - bin - lib spell_cmd: 'aspell --master=en_US list' stopwords: - CGI - autocomplete - checkbox - keygen - readonly - unsetting - unvisited wordlist: Pod::Wordlist name: Test::PodSpelling version: '2.007005' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: [] allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.34.1 repo_root: . name: Git::Check version: '2.051' - class: Dist::Zilla::Plugin::CheckStrictVersion name: CheckStrictVersion version: '0.001' - class: Dist::Zilla::Plugin::RunExtraTests config: Dist::Zilla::Role::TestRunner: default_jobs: '8' name: RunExtraTests version: '0.029' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: finder: - ':InstallModules' - ':PerlExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.019' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.019' - class: Pod::Weaver::Plugin::SingleEncoding name: '@Default/SingleEncoding' version: '4.019' - class: Pod::Weaver::Section::Name name: '@Default/Name' version: '4.019' - class: Pod::Weaver::Section::Version name: '@Default/Version' version: '4.019' - class: Pod::Weaver::Section::Region name: '@Default/prelude' version: '4.019' - class: Pod::Weaver::Section::Generic name: SYNOPSIS version: '4.019' - class: Pod::Weaver::Section::Generic name: DESCRIPTION version: '4.019' - class: Pod::Weaver::Section::Generic name: OVERVIEW version: '4.019' - class: Pod::Weaver::Section::Collect name: ATTRIBUTES version: '4.019' - class: Pod::Weaver::Section::Collect name: METHODS version: '4.019' - class: Pod::Weaver::Section::Collect name: FUNCTIONS version: '4.019' - class: Pod::Weaver::Section::Leftovers name: '@Default/Leftovers' version: '4.019' - class: Pod::Weaver::Section::Region name: '@Default/postlude' version: '4.019' - class: Pod::Weaver::Section::Authors name: '@Default/Authors' version: '4.019' - class: Pod::Weaver::Section::Legal name: '@Default/Legal' version: '4.019' name: PodWeaver version: '4.010' - class: Dist::Zilla::Plugin::CheckChangeLog name: CheckChangeLog version: '0.05' - class: Dist::Zilla::Plugin::CheckChangesHasContent name: CheckChangesHasContent version: '0.011' - class: Dist::Zilla::Plugin::TestRelease name: TestRelease version: '6.032' - class: Dist::Zilla::Plugin::UploadToCPAN name: UploadToCPAN version: '6.032' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: Markdown_Readme version: '0.163250' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - LICENSE - META.json - Makefile.PL - cpanfile match: [] name: CopyFilesFromRelease version: '0.007' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: recommends name: '@Git::VersionManager/pluginbundle version' version: '6.032' - class: Dist::Zilla::Plugin::RewriteVersion::Transitional config: Dist::Zilla::Plugin::RewriteVersion: add_tarball_name: 0 finders: - ':ExecFiles' - ':InstallModules' global: 0 skip_version_provider: 0 Dist::Zilla::Plugin::RewriteVersion::Transitional: {} name: '@Git::VersionManager/RewriteVersion::Transitional' version: '0.009' - class: Dist::Zilla::Plugin::MetaProvides::Update name: '@Git::VersionManager/MetaProvides::Update' version: '0.007' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - Changes match: [] name: '@Git::VersionManager/CopyFilesFromRelease' version: '0.007' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: v%V%n%n%c signoff: '0' Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - LICENSE - META.json - README.md - cpanfile allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.34.1 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Git::VersionManager/release snapshot' version: '2.051' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: v6.12 tag_format: v%V tag_message: v%V Dist::Zilla::Role::Git::Repo: git_version: 2.34.1 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Git::VersionManager/Git::Tag' version: '2.051' - class: Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional config: Dist::Zilla::Plugin::BumpVersionAfterRelease: finders: - ':ExecFiles' - ':InstallModules' global: 0 munge_makefile_pl: 1 Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional: {} name: '@Git::VersionManager/BumpVersionAfterRelease::Transitional' version: '0.009' - class: Dist::Zilla::Plugin::NextRelease name: '@Git::VersionManager/NextRelease' version: '6.032' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: 'increment $VERSION after %v release' signoff: '0' Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Build.PL - Changes - Makefile.PL allow_dirty_match: - (?^:^lib/.*\.pm$) changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.34.1 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Git::VersionManager/post-release commit' version: '2.051' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - origin remotes_must_exist: 1 Dist::Zilla::Role::Git::Repo: git_version: 2.34.1 repo_root: . name: Git::Push version: '2.051' - class: Dist::Zilla::Plugin::ConfirmRelease name: ConfirmRelease version: '6.032' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.032' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.032' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.032' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.032' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.032' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.032' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.032' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.032' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.032' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.032' - class: Dist::Zilla::Plugin::FinderCode name: MetaProvides::Package/AUTOVIV/:InstallModulesPM version: '6.032' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.032' x_contributors: - 'Adam Kennedy ' - 'Adam Sjogren ' - 'Alessandro Ghedini ' - 'Alexandr Ciornii ' - 'Alexey Tourbin ' - 'Alex Kapranoff ' - 'amire80 ' - 'Andreas J. Koenig ' - 'Bill Mann ' - 'Bron Gondwana ' - 'Daniel Hedlund ' - 'David E. Wheeler ' - 'DAVIDRW ' - 'David Steinbrunner ' - 'E. Choroba ' - 'Father Chrysostomos ' - 'Felix Ostmann ' - 'FWILES ' - 'Gavin Peters ' - 'Gil Magno ' - 'Gisle Aas ' - 'Gisle Aas ' - 'Gisle Aas ' - 'Gisle Aas ' - 'Graeme Thompson ' - 'Graham Knop ' - 'Hans-H. Froehlich ' - 'Ian Kilgore ' - 'Jacob J ' - 'James Raspass ' - 'jefflee ' - 'john9art ' - 'Julien Fiegehenn ' - 'Lance Wicks ' - 'Lukas Mai ' - 'Mark Stosberg ' - 'Mark Stosberg ' - 'Mark Stosberg ' - 'Mike Schilli ' - 'Mohammad S Anwar ' - 'mschilli ' - 'murphy ' - 'Olaf Alders ' - 'Ondrej Hanak ' - 'Peter Rabbitson ' - 'phrstbrn ' - 'Robert Stone ' - 'Rolf Grossmann ' - 'ruff ' - 'sasao ' - 'Sean M. Burke ' - 'Slaven Rezic ' - 'Slaven Rezic ' - 'Spiros Denaxas ' - 'Steve Hay ' - 'Todd Lipcon ' - 'Tom Hukins ' - 'Tony Finch ' - 'Toru Yamaguchi ' - 'uid39246 ' - 'Ville Skyttä ' - 'Yuri Karaban ' - 'Zefram ' x_generated_by_perl: v5.34.0 x_serialization_backend: 'YAML::Tiny version 1.74' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' HTML-Form-6.12/lib/0000775000175000017500000000000014704505176012314 5ustar olafolafHTML-Form-6.12/lib/HTML/0000775000175000017500000000000014704505176013060 5ustar olafolafHTML-Form-6.12/lib/HTML/Form/0000775000175000017500000000000014704505176013763 5ustar olafolafHTML-Form-6.12/lib/HTML/Form/ListInput.pm0000644000175000017500000001470514704505176016261 0ustar olafolafpackage HTML::Form::ListInput; use strict; use parent 'HTML::Form::Input'; use Carp 'croak'; our $VERSION = '6.12'; # ABSTRACT: An HTML form list input element for use with HTML::Form #select/option (val1, val2, ....) #input/radio (undef, val1, val2,...) #input/checkbox (undef, value) #select-multiple/option (undef, value) sub new { my $class = shift; my $self = $class->SUPER::new(@_); my $value = delete $self->{value}; my $value_name = delete $self->{value_name}; my $type = $self->{type}; if ( $type eq "checkbox" ) { $value = "on" unless defined $value; $self->{menu} = [ { value => undef, name => "off", }, { value => $value, name => $value_name, }, ]; $self->{current} = ( delete $self->{checked} ) ? 1 : 0; } else { $self->{option_disabled}++ if $type eq "radio" && delete $self->{disabled}; $self->{menu} = [ { value => $value, name => $value_name }, ]; my $checked = $self->{checked} || $self->{option_selected}; delete $self->{checked}; delete $self->{option_selected}; if ( exists $self->{multiple} ) { unshift( @{ $self->{menu} }, { value => undef, name => "off" } ); $self->{current} = $checked ? 1 : 0; } else { $self->{current} = 0 if $checked; } } $self; } sub add_to_form { my ( $self, $form ) = @_; my $type = $self->type; return $self->SUPER::add_to_form($form) if $type eq "checkbox"; if ( $type eq "option" && exists $self->{multiple} ) { $self->{disabled} ||= delete $self->{option_disabled}; return $self->SUPER::add_to_form($form); } Carp::croak "Assert" if @{ $self->{menu} } != 1; my $m = $self->{menu}[0]; $m->{disabled}++ if delete $self->{option_disabled}; # if there was no name we have to search for an input that explicitly has # no name either, because otherwise the name attribute would be ignored my $prev = $form->find_input( $self->{name} || \undef, $self->{type}, $self->{idx} ); return $self->SUPER::add_to_form($form) unless $prev; # merge menus $prev->{current} = @{ $prev->{menu} } if exists $self->{current}; push( @{ $prev->{menu} }, $m ); } sub fixup { my $self = shift; if ( $self->{type} eq "option" && !( exists $self->{current} ) ) { $self->{current} = 0; } $self->{menu}[ $self->{current} ]{seen}++ if exists $self->{current}; } sub disabled { my $self = shift; my $type = $self->type; my $old = $self->{disabled} || _menu_all_disabled( @{ $self->{menu} } ); if (@_) { my $v = shift; $self->{disabled} = $v; for ( @{ $self->{menu} } ) { $_->{disabled} = $v; } } return $old; } sub _menu_all_disabled { for (@_) { return 0 unless $_->{disabled}; } return 1; } sub value { my $self = shift; my $old; $old = $self->{menu}[ $self->{current} ]{value} if exists $self->{current}; $old = $self->{value} if exists $self->{value}; if (@_) { my $i = 0; my $val = shift; my $cur; my $disabled; for ( @{ $self->{menu} } ) { if ( ( defined($val) && defined( $_->{value} ) && $val eq $_->{value} ) || ( !defined($val) && !defined( $_->{value} ) ) ) { $cur = $i; $disabled = $_->{disabled}; last unless $disabled; } $i++; } if ( !( defined $cur ) || $disabled ) { if ( defined $val ) { # try to search among the alternative names as well my $i = 0; my $cur_ignorecase; my $lc_val = lc($val); for ( @{ $self->{menu} } ) { if ( defined $_->{name} ) { if ( $val eq $_->{name} ) { $disabled = $_->{disabled}; $cur = $i; last unless $disabled; } if ( !defined($cur_ignorecase) && $lc_val eq lc( $_->{name} ) ) { $cur_ignorecase = $i; } } $i++; } unless ( defined $cur ) { $cur = $cur_ignorecase; if ( defined $cur ) { $disabled = $self->{menu}[$cur]{disabled}; } elsif ( $self->{strict} ) { my $n = $self->name; Carp::croak("Illegal value '$val' for field '$n'"); } } } elsif ( $self->{strict} ) { my $n = $self->name; Carp::croak("The '$n' field can't be unchecked"); } } if ( $self->{strict} && $disabled ) { my $n = $self->name; Carp::croak("The value '$val' has been disabled for field '$n'"); } if ( defined $cur ) { $self->{current} = $cur; $self->{menu}[$cur]{seen}++; delete $self->{value}; } else { $self->{value} = $val; delete $self->{current}; } } $old; } sub check { my $self = shift; $self->{current} = 1; $self->{menu}[1]{seen}++; } sub possible_values { my $self = shift; map $_->{value}, grep !$_->{disabled}, @{ $self->{menu} }; } sub other_possible_values { my $self = shift; map $_->{value}, grep !$_->{seen} && !$_->{disabled}, @{ $self->{menu} }; } sub value_names { my $self = shift; my @names; for ( @{ $self->{menu} } ) { my $n = $_->{name}; $n = $_->{value} unless defined $n; push( @names, $n ); } @names; } 1; __END__ =pod =encoding UTF-8 =head1 NAME HTML::Form::ListInput - An HTML form list input element for use with HTML::Form =head1 VERSION version 6.12 =head1 AUTHOR Gisle Aas =head1 COPYRIGHT AND LICENSE This software is copyright (c) 1998 by Gisle Aas. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut HTML-Form-6.12/lib/HTML/Form/FileInput.pm0000644000175000017500000000406014704505176016216 0ustar olafolafpackage HTML::Form::FileInput; use strict; use parent 'HTML::Form::TextInput'; our $VERSION = '6.12'; # ABSTRACT: An HTML form file input element for use with HTML::Form sub file { my $self = shift; $self->value(@_); } sub filename { my $self = shift; my $old = $self->{filename}; $self->{filename} = shift if @_; $old = $self->file unless defined $old; $old; } sub content { my $self = shift; my $old = $self->{content}; $self->{content} = shift if @_; $old; } sub headers { my $self = shift; my $old = $self->{headers} || []; $self->{headers} = [@_] if @_; @$old; } sub form_name_value { my ( $self, $form ) = @_; return $self->SUPER::form_name_value($form) if $form->method ne "POST" || $form->enctype ne "multipart/form-data"; my $name = $self->name; return unless defined $name; return if $self->{disabled}; my $file = $self->file; my $filename = $self->filename; my @headers = $self->headers; my $content = $self->content; my %headers = @headers; if ( defined $content || grep m/^Content$/i, keys %headers ) { $filename = $file unless defined $filename; $file = undef; unshift( @headers, "Content" => $content ); } elsif ( !defined($file) || length($file) == 0 ) { return; } # legacy (this used to be the way to do it) if ( ref($file) eq "ARRAY" ) { my $f = shift @$file; my $fn = shift @$file; push( @headers, @$file ); $file = $f; $filename = $fn; } return ( $name => [ $file, $filename, @headers ] ); } 1; __END__ =pod =encoding UTF-8 =head1 NAME HTML::Form::FileInput - An HTML form file input element for use with HTML::Form =head1 VERSION version 6.12 =head1 AUTHOR Gisle Aas =head1 COPYRIGHT AND LICENSE This software is copyright (c) 1998 by Gisle Aas. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut HTML-Form-6.12/lib/HTML/Form/TextInput.pm0000644000175000017500000000227514704505176016271 0ustar olafolafpackage HTML::Form::TextInput; use strict; use parent 'HTML::Form::Input'; our $VERSION = '6.12'; # ABSTRACT: An HTML form text input element for use with HTML::Form #input/text #input/password #input/hidden #textarea sub value { my $self = shift; my $old = $self->{value}; $old = "" unless defined $old; if (@_) { Carp::croak("Input '$self->{name}' is readonly") if $self->{strict} && $self->{readonly}; my $new = shift; my $n = exists $self->{maxlength} ? $self->{maxlength} : undef; Carp::croak("Input '$self->{name}' has maxlength '$n'") if $self->{strict} && defined($n) && defined($new) && length($new) > $n; $self->{value} = $new; } $old; } 1; __END__ =pod =encoding UTF-8 =head1 NAME HTML::Form::TextInput - An HTML form text input element for use with HTML::Form =head1 VERSION version 6.12 =head1 AUTHOR Gisle Aas =head1 COPYRIGHT AND LICENSE This software is copyright (c) 1998 by Gisle Aas. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut HTML-Form-6.12/lib/HTML/Form/KeygenInput.pm0000644000175000017500000000137514704505176016567 0ustar olafolafpackage HTML::Form::KeygenInput; use strict; use parent 'HTML::Form::Input'; our $VERSION = '6.12'; # ABSTRACT: An HTML form keygen input element for use with HTML::Form sub challenge { my $self = shift; return $self->{challenge}; } sub keytype { my $self = shift; return lc( $self->{keytype} || 'rsa' ); } 1; __END__ =pod =encoding UTF-8 =head1 NAME HTML::Form::KeygenInput - An HTML form keygen input element for use with HTML::Form =head1 VERSION version 6.12 =head1 AUTHOR Gisle Aas =head1 COPYRIGHT AND LICENSE This software is copyright (c) 1998 by Gisle Aas. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut HTML-Form-6.12/lib/HTML/Form/ImageInput.pm0000644000175000017500000000166314704505176016367 0ustar olafolafpackage HTML::Form::ImageInput; use strict; use parent 'HTML::Form::SubmitInput'; our $VERSION = '6.12'; # ABSTRACT: An HTML form image input element for use with HTML::Form sub form_name_value { my $self = shift; my $clicked = $self->{clicked}; return unless $clicked; return if $self->{disabled}; my $name = $self->{name}; $name = ( defined($name) && length($name) ) ? "$name." : ""; return ( "${name}x" => $clicked->[0], "${name}y" => $clicked->[1] ); } 1; __END__ =pod =encoding UTF-8 =head1 NAME HTML::Form::ImageInput - An HTML form image input element for use with HTML::Form =head1 VERSION version 6.12 =head1 AUTHOR Gisle Aas =head1 COPYRIGHT AND LICENSE This software is copyright (c) 1998 by Gisle Aas. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut HTML-Form-6.12/lib/HTML/Form/Input.pm0000644000175000017500000000677314704505176015433 0ustar olafolafpackage HTML::Form::Input; use strict; our $VERSION = '6.12'; # ABSTRACT: A generic HTML form input element for use with HTML::Form sub new { my $class = shift; my $self = bless {@_}, $class; $self; } sub add_to_form { my ( $self, $form ) = @_; push( @{ $form->{'inputs'} }, $self ); $self; } sub strict { my $self = shift; my $old = $self->{strict}; if (@_) { $self->{strict} = shift; } $old; } sub fixup { } sub type { shift->{type}; } sub name { my $self = shift; my $old = $self->{name}; $self->{name} = shift if @_; $old; } sub id { my $self = shift; my $old = $self->{id}; $self->{id} = shift if @_; $old; } sub class { my $self = shift; my $old = $self->{class}; $self->{class} = shift if @_; $old; } sub selected { my ( $self, $sel ) = @_; return undef unless defined $sel; my $attr = $sel =~ s/^\^// ? "name" : $sel =~ s/^#// ? "id" : $sel =~ s/^\.// ? "class" : "name"; return 0 unless defined $self->{$attr}; return $self->{$attr} eq $sel; } sub value { my $self = shift; my $old = $self->{value}; $self->{value} = shift if @_; $old; } sub autocomplete { my $self = shift; my $old = $self->{autocomplete}; $self->{autocomplete} = shift if @_; $old; } sub possible_values { return; } sub other_possible_values { return; } sub value_names { return; } sub readonly { my $self = shift; my $old = $self->{readonly}; $self->{readonly} = shift if @_; $old; } sub disabled { my $self = shift; my $old = $self->{disabled}; $self->{disabled} = shift if @_; $old; } sub form_name_value { my $self = shift; my $name = $self->{'name'}; return unless defined $name; return if $self->disabled; my $value = $self->value; return unless defined $value; s/\x0d?\x0a|\x0d/\x0d\x0a/g for $name, $value; return ( $name => $value ); } sub dump { my $self = shift; my $name = $self->name; $name = "" unless defined $name; my $value = $self->value; $value = "" unless defined $value; my $dump = "$name=$value"; my $type = $self->type; $type .= " disabled" if $self->disabled; $type .= " readonly" if $self->readonly; return sprintf "%-30s %s", $dump, "($type)" unless $self->{menu}; my @menu; my $i = 0; for ( @{ $self->{menu} } ) { my $opt = $_->{value}; $opt = "" unless defined $opt; $opt .= "/$_->{name}" if defined $_->{name} && length $_->{name} && $_->{name} ne $opt; substr( $opt, 0, 0 ) = "-" if $_->{disabled}; if ( exists $self->{current} && $self->{current} == $i ) { substr( $opt, 0, 0 ) = "!" unless $_->{seen}; substr( $opt, 0, 0 ) = "*"; } else { substr( $opt, 0, 0 ) = ":" if $_->{seen}; } push( @menu, $opt ); $i++; } return sprintf "%-30s %-10s %s", $dump, "($type)", "[" . join( "|", @menu ) . "]"; } 1; __END__ =pod =encoding UTF-8 =head1 NAME HTML::Form::Input - A generic HTML form input element for use with HTML::Form =head1 VERSION version 6.12 =head1 AUTHOR Gisle Aas =head1 COPYRIGHT AND LICENSE This software is copyright (c) 1998 by Gisle Aas. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut HTML-Form-6.12/lib/HTML/Form/SubmitInput.pm0000644000175000017500000000176014704505176016606 0ustar olafolafpackage HTML::Form::SubmitInput; use strict; use parent 'HTML::Form::Input'; our $VERSION = '6.12'; # ABSTRACT: An HTML form submit input element for use with HTML::Form #input/image #input/submit sub click { my ( $self, $form, $x, $y ) = @_; for ( $x, $y ) { $_ = 1 unless defined; } local ( $self->{clicked} ) = [ $x, $y ]; local ( $self->{value} ) = "" unless defined $self->value; return $form->make_request; } sub form_name_value { my $self = shift; return unless $self->{clicked}; return $self->SUPER::form_name_value(@_); } 1; __END__ =pod =encoding UTF-8 =head1 NAME HTML::Form::SubmitInput - An HTML form submit input element for use with HTML::Form =head1 VERSION version 6.12 =head1 AUTHOR Gisle Aas =head1 COPYRIGHT AND LICENSE This software is copyright (c) 1998 by Gisle Aas. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut HTML-Form-6.12/lib/HTML/Form/IgnoreInput.pm0000644000175000017500000000140514704505176016562 0ustar olafolafpackage HTML::Form::IgnoreInput; use strict; use parent 'HTML::Form::Input'; our $VERSION = '6.12'; # ABSTRACT: An HTML form ignored input element for use with HTML::Form # This represents buttons and resets whose values shouldn't matter # but should buttons not be like submits?! #input/button #input/reset sub value { return } 1; __END__ =pod =encoding UTF-8 =head1 NAME HTML::Form::IgnoreInput - An HTML form ignored input element for use with HTML::Form =head1 VERSION version 6.12 =head1 AUTHOR Gisle Aas =head1 COPYRIGHT AND LICENSE This software is copyright (c) 1998 by Gisle Aas. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut HTML-Form-6.12/lib/HTML/Form.pm0000644000175000017500000010115514704505176014322 0ustar olafolafpackage HTML::Form; use strict; use URI; use Carp (); use Encode (); use HTML::Form::TextInput (); use HTML::Form::IgnoreInput (); use HTML::Form::ListInput (); use HTML::Form::SubmitInput (); use HTML::Form::ImageInput (); use HTML::Form::FileInput (); use HTML::Form::KeygenInput (); our $VERSION = '6.12'; my %form_tags = map { $_ => 1 } qw(input textarea button select option); my %type2class = ( text => "TextInput", password => "TextInput", hidden => "TextInput", textarea => "TextInput", "reset" => "IgnoreInput", radio => "ListInput", checkbox => "ListInput", option => "ListInput", button => "SubmitInput", submit => "SubmitInput", image => "ImageInput", file => "FileInput", keygen => "KeygenInput", ); # The new HTML5 input types %type2class = ( %type2class, map { $_ => 'TextInput' } qw( tel search url email datetime date month week time datetime-local number range color ) ); # ABSTRACT: Class that represents an HTML form element sub parse { my $class = shift; my $html = shift; unshift( @_, "base" ) if @_ == 1; my %opt = @_; require HTML::TokeParser; my $p = HTML::TokeParser->new( ref($html) ? $html->decoded_content( ref => 1 ) : \$html ); Carp::croak "Failed to create HTML::TokeParser object" unless $p; my $base_uri = delete $opt{base}; my $charset = delete $opt{charset}; my $strict = delete $opt{strict}; my $verbose = delete $opt{verbose}; if ($^W) { Carp::carp("Unrecognized option $_ in HTML::Form->parse") for sort keys %opt; } unless ( defined $base_uri ) { if ( ref($html) ) { $base_uri = $html->base; } else { Carp::croak("HTML::Form::parse: No \$base_uri provided"); } } unless ( defined $charset ) { if ( ref($html) and $html->can("content_charset") ) { $charset = $html->content_charset; } unless ($charset) { $charset = "UTF-8"; } } my @forms; my $f; # current form my %openselect; # index to the open instance of a select while ( my $t = $p->get_tag ) { my ( $tag, $attr ) = @$t; if ( $tag eq "form" ) { my $action = delete $attr->{'action'}; $action = "" unless defined $action; $action = URI->new_abs( $action, $base_uri ); $f = $class->new( $attr->{'method'}, $action, $attr->{'enctype'} ); $f->accept_charset( $attr->{'accept-charset'} ) if $attr->{'accept-charset'}; $f->{default_charset} = $charset; $f->{attr} = $attr; $f->strict(1) if $strict; %openselect = (); push( @forms, $f ); my ( %labels, $current_label ); while ( my $t = $p->get_tag ) { my ( $tag, $attr ) = @$t; last if $tag eq "/form"; if ( $tag ne 'textarea' ) { # if we are inside a label tag, then keep # appending any text to the current label if ( defined $current_label ) { $current_label = join " ", grep { defined and length } $current_label, $p->get_phrase; } } if ( $tag eq "input" ) { $attr->{value_name} = exists $attr->{id} && exists $labels{ $attr->{id} } ? $labels{ $attr->{id} } : defined $current_label ? $current_label : $p->get_phrase; } if ( $tag eq "label" ) { $current_label = $p->get_phrase; $labels{ $attr->{for} } = $current_label if exists $attr->{for}; } elsif ( $tag eq "/label" ) { $current_label = undef; } elsif ( $tag eq "input" ) { my $type = delete $attr->{type} || "text"; $f->push_input( $type, $attr, $verbose ); } elsif ( $tag eq "button" ) { my $type = delete $attr->{type} || "submit"; $f->push_input( $type, $attr, $verbose ); } elsif ( $tag eq "textarea" ) { $attr->{textarea_value} = $attr->{value} if exists $attr->{value}; my $text = $p->get_text("/textarea"); $attr->{value} = $text; $f->push_input( "textarea", $attr, $verbose ); } elsif ( $tag eq "select" ) { # rename attributes reserved to come for the option tag for ( "value", "value_name" ) { $attr->{"select_$_"} = delete $attr->{$_} if exists $attr->{$_}; } # count this new select option separately my $name = $attr->{name}; $name = "" unless defined $name; $openselect{$name}++; while ( $t = $p->get_tag ) { my $tag = shift @$t; last if $tag eq "/select"; next if $tag =~ m,/?optgroup,; next if $tag eq "/option"; if ( $tag eq "option" ) { my %a = %{ $t->[0] }; # rename keys so they don't clash with %attr for ( keys %a ) { next if $_ eq "value"; $a{"option_$_"} = delete $a{$_}; } while ( my ( $k, $v ) = each %$attr ) { $a{$k} = $v; } $a{value_name} = $p->get_trimmed_text; $a{value} = delete $a{value_name} unless defined $a{value}; $a{idx} = $openselect{$name}; $f->push_input( "option", \%a, $verbose ); } else { warn("Bad here, so we # try to do the same. Actually the MSIE behaviour # appears really strange: and