HTML-FillInForm-Lite
view release on metacpan or search on metacpan
lib/HTML/FillInForm/Lite.pm view on Meta::CPAN
Note that C<HTML::FillInForm> always decodes HTML entities in state fields,
but not supports this option.
=item layer => I<:iolayer>
To read a file with I<:iolayer>. It is used when a file name is supplied as
I<source>.
For example:
# To read a file encoded in UTF-8
$fif = HTML::FillInForm::Lite->new(layer => ':utf8');
$output = $fif->fill($utf8_file, $fdat);
# To read a file encoded in EUC-JP
$fif = HTML::FillInForm::Lite->new(layer => ':encoding(euc-jp)');
$output = $fif->fill($eucjp_file, $fdat);
Note that it is not implemented in C<HTML::FillInForm>.
=back
=head2 fill(source, form_data [, options...])
Fills in I<source> with I<form_data>. If I<source> or I<form_data> is not
supplied, it will cause C<die>.
I<options> are the same as C<new()>'s.
You can use this method as a both class or instance method,
but you make multiple calls to C<fill()> with the B<same>
options, it is a little faster to call C<new()> and store the instance.
I<source> may be a scalar reference, an array reference of strings, or
a file name.
I<form_data> may be a hash reference, an object with C<param()> method,
an object with accessors, a code reference, or an array reference of
those above mentioned.
If I<form_data> is based on procedures (i.e. not a hash reference),
the procedures will be called in the list context.
Therefore, to leave some fields untouched, it must return a null list C<()>,
not C<undef>.
=head1 DEPENDENCIES
Perl 5.8.1 or later.
=head1 NOTES
=head2 Compatibility with C<HTML::FillInForm>
This module implements only the new syntax of C<HTML::FillInForm>
version 2. However, C<HTML::FillInForm::Lite::Compat> provides
an interface compatible with C<HTML::FillInForm>.
=head2 Compatibility with legacy HTML
This module is designed to process XHTML 1.x.
And it also supporting a good part of HTML 4.x , but there are some
limitations. First, it doesn't understand HTML-attributes that the name is
omitted.
For example:
<INPUT TYPE=checkbox NAME=foo CHECKED> -- NG.
<INPUT TYPE=checkbox NAME=foo CHECKED=checked> - OK, but obsolete.
<input type="checkbox" name="foo" checked="checked" /> - OK, valid XHTML
Then, it always treats the values of attributes case-sensitively.
In the example above, the value of C<type> must be lower-case.
Moreover, it doesn't recognize omitted closing tags, like:
<select name="foo">
<option>bar
<option>baz
</select>
When you can't get what you want, try to give your source to a HTML lint.
=head2 Comment handling
This module processes all the processable, not knowing comments
nor something that shouldn't be processed.
It may cause problems. Suppose there is a code like:
<script> document.write("<input name='foo' />") </script>
C<HTML::FillInForm::Lite> will break the code:
<script> document.write("<input name='foo' value="bar" />") </script>
To avoid such problems, you can use the C<ignore_fields> option.
=head1 BUGS
No bugs have been reported.
Please report any bug or feature request to E<lt>gfuji(at)cpan.orgE<gt>,
or through the RT L<http://rt.cpan.org/>.
=head1 SEE ALSO
L<HTML::FillInForm>.
L<HTML::FillInForm::Lite::JA> - the document in Japanese.
L<HTML::FillInForm::Lite::Compat> - HTML::FillInForm compatibility layer
=head1 AUTHOR
Goro Fuji (è¤ å¾é) E<lt>gfuji(at)cpan.orgE<gt>
=head1 LICENSE AND COPYRIGHT
Copyright (c) 2008-2010 Goro Fuji, Some rights reserved.
( run in 0.604 second using v1.01-cache-2.11-cpan-0bd6704ced7 )