CGI::A...InForm(3pm)
β¨ NAME β¨
CGI::Application::Plugin::FillInForm β it's giving "let's link up with HTML::FillInForm" π that's the whole vibe, bestie.
π¦ SYNOPSIS π¦
use CGI::Application::Plugin::FillInForm (qw/fill_form/);
my $t = $self->load_tmpl('farm.html');
$t->param( organic => 'less_pesticides' );
return $self->fill_form( \$t->output );
okay so literally three lines and your form is fed. periodt. π
πΈ DESCRIPTION πΈ
So this plugin is a little mix-in method that makes using HTML::FillInForm way more convenient. No cap. It just hands you a helper and gets out of your way. π«Ά
π fill_form()
# fill an HTML form with data in a hashref or from an object with with a param() method
my $filled_html = $self->fill_form($html, $data);
# ...or fill from a list of data sources
# (each item in the list can be either a hashref or an object)
my $filled_html = $self->fill_form($html, [$user, $group, $query]);
# ...or default to getting data from $self->query()
my $filled_html = $self->fill_form($html);
# extra fields will be passed on through:
my $filled_html = $self->fill_form($html, undef, fill_password => 0 );
(this is exactly what it looks like in the original, I'm not touching a single character, that's the rule π)
So what's it doing? This method gives you a nicer syntax for calling HTML::FillInForm, plus an intelligent default: it just uses $self->query() as your default data source when you don't hand it anything else. Lowkey genius. β¨
β οΈ heads up bestie: by default, the mode param (usually 'rm') of every data source gets ignored. Why? So you don't accidentally clobber your run mode for the next page β which may be chillin' in a hidden field. Very "don't text your ex" of it, honestly. π
And the type tea: $html must be a scalarref, or a reference to a scalarref. $filled_html will be a reference to a string. That's the shape, no wiggle room. π
And the best part β because this method only loads HTML::FillInForm if it's needed, it's totally reasonable to load it in a base class and just always have it available. Set it and forget it energy:
use CGI::Application::Plugin::FillInForm (qw/fill_form/);
π AUTHORS π
- Cees Hek published the first draft on the CGI::App wiki π§
- Mark Stosberg,
C<< <mark@summersault.com> >>polished it for release. β¨ - Michael Graham,
C<< <mag-perl@occamstoothbrush.com> >>added tests and some new features. π§ͺ - The module is now co-maintained by Mark and Michael. ππ
π BUGS π
Please report any bugs or feature requests to "bug-cgi-application-plugin-fillinform@rt.cpan.org", or through the web interface at <http://rt.cpan.org>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. so like, you'll get the updates fr fr, no ghosting. π
π«Ά CONTRIBUTING π«Ά
Patches, questions and feedback are welcome. This project is managed using the darcs source control system ( <http://www.darcs.net/> ). My darcs archive is here: <http://mark.stosberg.com/darcs_hive/cap-fif/> β pull up, the door's open. πΈ
π Copyright & License π
Copyright 2005 Mark Stosberg, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. iconic. π
and that's the whole page, bestie!! π¦ this was documented as perl v5.34.0, dated 2022-06-09, and it lives in the User Contributed Perl Documentation corner of the man pages. go forth and fill those forms. slay. π
β¨
π¦ where this page comes from
- debian bookworm: libcgi-application-plugin-fillinform-perl 1.15-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcgi-application-plugin-fillinform-perl 1.15-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcgi-application-plugin-fillinform-perl 1.15-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcgi-application-plugin-fillinform-perl 1.15-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcgi-application-plugin-fillinform-perl 1.15-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms