HTML::...llback(3pm)

πŸ“¦
version 2.07000 Β· 5 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– 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_filter energy. 🫢
  • 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> πŸ’…


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