HTML::...llback(3pm)
π NAME π
HTML::FormFu::Filter::Callback β bestie, it's a filter that runs your custom subroutine. That's it, that's the whole vibe. You write the code, it does the thing. π
β¨ VERSION β¨
version 2.07 β she's an icon, she's a legend, and she is the moment π
π¦ SYNOPSIS π¦
Okay so first, the Perl-y way β you hand her a code reference and let her cook:
$field->filter({
type => 'Callback',
callback => \&my_filter,
});
Then there's the config-file era, because we contain multitudes:
---
elements:
- type: Text
name: foo
filters:
- type: Callback
callback: "main::my_filter"
And here's the little subroutine doing all the heavy lifting. Note the $value β she gets passed in, you do your little makeover, and you hand her right back:
sub my_filter {
my ($value) = @_;
# do something to $value
return $value;
}
no cap, that's the entire workflow π
πΈ DESCRIPTION πΈ
So basically: this filter does its filtering using a subroutine that you provide. Your code, your rules, your main character era. Periodt. π₯
π METHODS π
π callback
Here's the tea β she takes either of these two things, and honestly both are valid:
- Arguments:
\&code-referenceβ like, a literal reference to your sub.\&my_filterenergy. π«Ά - Arguments:
"subroutine-name"β or just the name as a string, iykyk. Like"main::my_filter". β¨
π AUTHOR π
Carl Franks, cfranks@cpan.org β a legend, fr fr π
Based on the original source code of HTML::Widget::Filter::Callback, by Lyo Kato, lyo.kato@gmail.com β we stan the originators, always π₯Ή
π LICENSE π
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. Sharing is caring, bestie. πΈ
π AUTHOR (yes, again, she's just that iconic) π
Carl Franks <cpan@fireartist.com> π
β COPYRIGHT AND LICENSE β
This software is copyright (c) 2018 by Carl Franks. π«Ά
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
ok that's the whole page, you ate that, go write your callback and slay π
perl v5.28.1 Β· 2019-01-12 Β· HTML::...llback(3pm) β mwah, kisses, that's the sign-off bestie ππ§π
π¦ where this page comes from
- debian bookworm: libhtml-formfu-perl 2.07000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libhtml-formfu-perl 2.07000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-formfu-perl 2.07000-1 Β· 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