CGI::T...:Input(3pm)
β¨ NAME β¨
okay so bestie, welcome to CGI::Test::Form::Widget::Input (3pm) β the abstract representation of an input field π
she's a Perl module, she's iconic, she's the blueprint, not the actual thing. Periodt.
π¦ SYNOPSIS π¦
# Inherits from CGI::Test::Form::Widget
that's it. that's the whole vibe. she's a child class and she knows it π
πΈ DESCRIPTION πΈ
so this class is the abstract representation of a text input field, which like β bestie β covers a LOT of ground. we're talking:
- a text field
- a password field
- a file upload field
- a text area
basically every place a user can type their little heart out π
and because typing is literally the main character of this whole situation, there's a whole squad of routines to simulate user input in those fields. you can prepend(), append(), replace(), clear(), or even run whatever text is already sitting there through a filter(). it's giving full editorial control over the text β¨
π INTERFACE π
the interface is the same as the one described in CGI::Test::Form::Widget, with the following additions:
π Attribute Setting π
there are a number of convenience routines that are wrappers on set_value() β think of them as the cute lil shortcuts so you don't have to do the whole thing yourself π«Ά
appendstring β Appends the string text to the existing text.clearβ Clears existing text.filterfilter_routine β Runs existing text through the given filter_routine. The$_variable is set to the whole text value, and is made available to the filter. Hence you may write:
$input->filter(sub { s/this/that/g });
to replace all instances of this by that within the input text. ngl that one's kinda chef's kiss π©βπ³π
prependstring β Prepends the string text to the existing text.replacestring β Replaces the existing text with string.
π§ Widget Classification Predicates π§
there are additional predicates to distinguish between the various input fields β like a vibe check but for widget types π
is_areaβ Returns true for a text area.is_fieldβ Returns true for a pure text field.is_fileβ Returns true for a file upload field (text field with browser support for file selection).is_passwordβ Returns true for a password field (text field with input masked by GUI).
π AUTHORS π
giving credit where credit is due, no cap:
- The original author is Raphael Manfredi.
- Steven Hilton was long time maintainer of this module.
- Current maintainer is Alexander Tokarev
<tokarev@cpan.org>.
β SEE ALSO β
go read these next, bestie, they're the whole friend group π
CGI::Test::Form::Widget(3)CGI::Test::Form::Widget::Input::File(3)CGI::Test::Form::Widget::Input::Password(3)CGI::Test::Form::Widget::Input::Text_Area(3)CGI::Test::Form::Widget::Input::Text_Field(3)
okay that's the whole page, mwah π this lil gem shipped with perl v5.34.0 back on 2022-06-10, and honestly? she still slays. periodt. πβ¨π¦
π¦ where this page comes from
- debian bookworm: libcgi-test-perl 1.111-2 Β· Artistic-1.0-Perl
- debian trixie: libcgi-test-perl 1.111-2 Β· Artistic-1.0-Perl
- ubuntu noble: libcgi-test-perl 1.111-2 Β· Artistic-1.0-Perl
- ubuntu resolute: libcgi-test-perl 1.111-2 Β· Artistic-1.0-Perl
- ubuntu stonking: libcgi-test-perl 1.111-2 Β· Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms