CGI::A...vPopup(3pm)
π CGI::Application::Plugin::DevPopup(3pm) π
So the manual name is CGI::Application::Plugin::DevPopup and bestie, it does exactly what it says on the tin: runtime cgiapp info in a popup window. Iconic. Let's get into it.
β¨ VERSION β¨
version 1.08 β periodt.
πΈ SYNOPSIS πΈ
π End user information
Okay so this module is literally a plugin framework for showing runtime info about your CGI::Application app in a popup window. There's a sample Timing plugin bundled so you can see the whole vibe in action:
BEGIN { $ENV{'CAP_DEVPOPUP_EXEC'} = 1; } # turn it on for real
use CGI::Application::Plugin::DevPopup;
use CGI::Application::Plugin::DevPopup::Timing;
The rest of your application follows
...
Now every time you hit a runmode, a window pops up over your content showing you how long all the various stages took. Add more CAP::DevPopup plugins and you get more info β it's giving customizable dashboard energy. There's even an HTML::Tidy plugin that shows you how your document conforms to W3C standards: see CGI::Application::Plugin::HtmlTidy. Obsessed.
The output is a Table of Contents plus a bunch of reports. A rough translation into plain text looks like this:
Devpopup report for My::App -> add_timing
* Timings - Total runtime: 3.1178 sec.
+-----------------------------------------------------------------------+
| Timings |
+-----------------------------------------------------------------------+
| Application started at: Thu Sep 22 02:55:35 2005 |
| From To Time taken |
|-----------------------------------------------------------------------|
| init prerun 0.107513 sec. |
| prerun before expensive operation 0.000371 sec. |
| before expensive operation after expensive operation 3.006688 sec. |
| after expensive operation load_tmpl(dp.html) 0.000379 sec. |
| load_tmpl(dp.html) postrun 0.002849 sec. |
+-----------------------------------------------------------------------+
The reports expand and collapse when you click on the ToC entry or the report header. Cute little accordion moment. π«Ά
π¦ Developer information
Making your own plugin for DevPopup is lowkey simple. CAP::DevPopup registers a new callback point called devpopup_report, and it uses that to collect output from your plugin. You add a callback to that point and return your formatted output from there. The callback has this signature:
sub callback($cgiapp_class, $outputref)
You pass your output to the devpopup object by calling
$cgiapp_class->devpopup->add_report(
title => $title,
summary => $summary,
report => $body,
);
Why are you getting $outputref, you ask? Because DevPopup wants to be the last one called in the postrun callback β main character energy, honestly. So if you wanted to do stuff at postrun time, please do it with this variable, and not through a callback at postrun. No cap.
π§ The "on" switch
Since this is primarily a development plugin and you would not want it running in your production code (π imagine), an environment variable named CAP_DEVPOPUP_EXEC has to be set to 1 for this module to function β and it must be present at compile time. That means you should place it in a BEGIN{} block, or use SetEnv or PerlSetEnv (remember to set those before any PerlRequire or PerlModule lines!).
Absence of the environment variable turns this module into a no-op: the plugin and its plugins are still loaded, but they won't modify your output. So it just... sits there. Vibing. Not touching anything.
π Available Plugins
CGI::Application::Plugin::DevPopup::Timing,CGI::Application::Plugin::DevPopup::LogandCGI::Application::Plugin::DevPopup::HTTPHeadersare bundled with this distribution.CGI::Application::Plugin::HtmlTidyintegrates with this module.CGI::Application::Plugin::TTintegrates with this module.
π EXPORTS
devpopup
This method is the only one exported into your module, and it's how you access the underlying DevPopup object. See below for the methods this object exposes. β¨
π METHODS
add_report( %fields )
Adds a new report about the current run of the application. The following fields are supported:
title
A short title for your report.
summary
An optional one- or two-line summary of your findings.
report
Your full output.
severity
An optional value specifying the importance of your report. Accepted values are qw/debug info warning error fatal/. This value is used to color-code the report headers. Yes bestie, color-coded severity. π
script
If you have custom javascript, then please pass it in through this field. Otherwise if it's embedded in your report, it will break the popup window β and we do not want that. I will take care of the surrounding "<script"> tags, so just the code body is needed.
β INSTALLATION
INSTALLATION
To install this module, run:
cpan CGI::Application::Plugin::DevPopup
To mnually install this module, run the following commands:
perl Makefile.PL
make
make test
make install
π SEE ALSO
CGI::Application. CGI::Application::Plugin::DevPopup::Timing
π AUTHOR
Rhesa Rozendaal, rhesa@cpan.org
π BUGS
Please report any bugs or feature requests to bug-cgi-application-plugin-devpopup@rt.cpan.org, or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Application-Plugin-DevPopup>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. fr fr, you'll be in the loop.
π₯ ACKNOWLEDGEMENTS
- Mark Stosberg for the initial idea, and for pushing me to write it.
- Sam Tregar for providing me with the skeleton cgiapp_postrun.
- Joshua Miller for providing the ::Log plugin.
- Everybody on the cgiapp mailinglist and on #cgiapp for cheering me on :-)
πΈ COPYRIGHT & LICENSE
Copyright 2005-2007 Rhesa Rozendaal, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
That's the whole page, bestie π This gem was rendered byperl v5.30.3and dated2020-09-25β go forth and pop those popups. π¦β¨
π¦ where this page comes from
- debian bookworm: libcgi-application-plugin-devpopup-perl 1.08+~cs2.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcgi-application-plugin-devpopup-perl 1.08+~cs2.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libcgi-application-plugin-devpopup-perl 1.08+~cs2.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcgi-application-plugin-devpopup-perl 1.08+~cs2.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcgi-application-plugin-devpopup-perl 1.08+~cs2.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcgi-application-plugin-devpopup-perl 1.08+~cs2.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms