Plack:...::Base(3pm)

πŸ“¦
version 0.18 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Plack::Middleware::Debug::Base β€” the base class for Debug panels, bestie ✨

Manual page situation: this is Plack:...::Base(3pm) from the User Contributed Perl Documentation, and we're about to make it make sense 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

package Plack::Middleware::Debug::YourPanel;
use parent qw(Plack::Middleware::Debug::Base);

sub run {
    my($self, $env, $panel) = @_;

    # Do something before the application runs

    return sub {
        my $res = shift;

        # Do something after the application returns

    };
}

✨ DESCRIPTION ✨

Okay so, this is the base class for panels. That's the whole vibe. It's the parent class you inherit from when you're building your own Debug panel, so you don't have to reinvent the whole thing yourself. Iconic behavior, honestly πŸ‘‘


🌸 METHODS 🌸

  • run β€” this method gets called when a request has arrived, before the main application runs. It's giving "quick, do your little thing before the real app takes the stage" πŸŽ€

The parameters it hands you are $env, which is the PSGI environment hash reference, and $panel, which is a Plack::Middleware::Debug::Panel object. Two little besties passed straight into your method, no cap πŸ’…

Now, if your panel needs to do some response munging, you should return a callback that takes $res β€” the response object. And here's the cute part: because you can return a closure, that response filter can also use $env and $panel easily. Closure said "I contain multitudes" and honestly? Slay πŸ”₯


πŸ’€ BUGS AND LIMITATIONS πŸ’€

No bugs have been reported. Not one. Zero. The vibe check passed, fr fr ✨

Please report any bugs or feature requests through the web interface at <http://rt.cpan.org> πŸ›


🧚 INSTALLATION 🧚

See perlmodinstall for information and options on installing Perl modules. It's got you covered on the how-to, bestie πŸ“¦


🌈 AVAILABILITY 🌈

The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find a CPAN site near you. Or see <http://search.cpan.org/dist/Plack-Middleware-Debug/> πŸ’–

The development version lives at <http://github.com/miyagawa/plack-middleware-debug/>. Instead of sending patches, please fork this project using the standard git and github infrastructure. Fork it, bestie, it's the moment 🌸


πŸ‘‘ AUTHORS πŸ‘‘

  • Marcel Gruenauer, <marcel@cpan.org>
  • Tatsuhiko Miyagawa, <miyagawa@bulknews.net>

Copyright 2009 by Marcel Gruenauer

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


okay that's the whole page, no notes, you understood all of it, I'm so proud of you 🫢

Sign-off time: this was rendered by perl v5.36.0, dated 2022-10-14, and it's the Plack:...::Base(3pm) page from the User Contributed Perl Documentation. Byeee, go write a panel πŸ’œ

πŸ“¦ where this page comes from