CGI::Ap...Starter(3)
β¨ CGI::Ap...Starter(3) β¨
hiii bestie π so this is a page from the User Contributed Perl Documentation, and it's literally about a little module starter that slays. buckle up, we're doing this together π«Ά
πΈ NAME πΈ
CGI::Application::Structured::Tools::Starter β a template based module starter for CGI::Application::Structured apps. it's giving scaffolding, it's giving "here's your whole skeleton already done" π
π SYNOPSIS π
use Module::Starter qw(
Module::Starter::Simple
Module::Starter::Plugin::Template
CGI::Application::Structured::Tools::Starter
);
Module::Starter->create_distro(%args);
π¦ ABSTRACT π¦
okay so the preferred way to use this module? bestie, don't even come at it directly. go through the cas-starter.pl in scripts script. that's the move. periodt.
β VERSION β
Version 0.015. that's the one. π
π DESCRIPTION π
so this is a plugin for Module::Starter π what it does is build you a skeleton CGI::Application::Structured module, plus all the extra little files you need to actually package it up for CPAN. no cap, it also generates:
- an
CGI::Application::Structuredcontroller base class for your modules - a customized
CGI::Application::Dispatchsubclass - a preconfigured development config file
- a
server.plthat runs out of the box - helper scripts to generate Controller modules subclasses
- a helper script to generate
DBIx::Classschema and result classes.
and like, credit where it's due β this module is inspired by Module::Starter::Plugin::CGIApp by Jaldhar H. Vyas. iconic behavior, we love an homage π«Ά
π METHODS π
π new ( %args ) π
this method calls the new supermethod from Module::Starter::Plugin::Template and then initializes the template store and renderer. (see templates and renderer below, bestie, they're literally right there.)
π create_distro ( %args ) π
this method works as advertised in Module::Starter. no notes. it does what it says on the tin β¨
π create_t( @modules ) π
this method creates a bunch of *.t files. @modules is a list of all modules in the distribution. test files go brrr πΈ
π render( $template, \%options ) π
this method is subclassed from Module::Starter::Plugin::Template.
it is given an HTML::Template and options and returns the resulting document.
here's the cute part: data in the Module::Starter object which represents a reference to an array @foo is transformed into an array of hashes with one key called $foo_item in order to make it usable in an HTML::Template TMPL_LOOP. for example:
$data = ['a'. 'b', 'c'];
would become:
$data = [
{ data_item => 'a' },
{ data_item => 'b' },
{ data_item => 'c' },
];
so that in the template you could say:
<tmpl_loop data>
<tmpl_var data_item>
</tmpl_loop>
the way that transformation works?? obsessed. π
π renderer () π
this method is subclassed from Module::Starter::Plugin::Template but doesn't do anything, because the actual template is created by render in this implementation. it's the friend who shows up to the group hang and contributes β¨vibesβ¨ only. and honestly? valid.
π templates () π
this method is subclassed from Module::Starter::Plugin::Template.
it reads in the template files and populates the object's templates attribute. the module template directory is found by checking the MODULE_TEMPLATE_DIR environment variable and then the config option template_dir. yes bestie, in that order β env var first, config option second. iykyk π¦
π create_MANIFEST_SKIP() π
this method creates a MANIFEST.SKIP file in the distribution's directory so that unneeded files can be skipped from inclusion in the distribution. bye bye, clutter π
π create_perlcriticrc () π
this method creates a perlcriticrc in the distribution's test directory so that the behavior of perl-critic.t can be modified. tune it how you like, bestie π
π create_server_pl () π
this method creates server.pl in the distribution's root directory. just. right there. in the root. π₯
π create_debug_sh () π
this method creates debug.sh in the distribution's root directory. starts werver with environment set to display ::Plugin::DebugScreen on error. debug mode but make it β¨dramaticβ¨ π
π create_config_pl () π
this method creates config-test.pl in the distribution's root/config directory.
π create_create_pl () π
this method creates create_controller.pl in the distribution's app/script directory.
π create_tmpl () π
this method takes all the template files ending in .tmpl (representing HTML::Template's) and installs them into a directory under the distro tree. for instance, if the distro was called Foo-Bar, the templates would be installed in Foo-Bar/templates.
note: the files will just be copied over, not rendered. so don't come for me when your template vars are still sitting there raw. π
π create_submodule () π
implements a default Home subclass of the main module. this module will be auto configured as the default module in the Dispatch subclass. main character energy, fr fr π
π create_submodule () π
implements a default controller baseclass (main module).
(yes bestie, it's listed twice with the same name in the original. we don't ask questions, we just transcribe π )
π create_dbic_pl () π
this method creates create_dbic_schema.pl in the distribution's root/script/ directory.
π create_dispatch () π
implements a CGI::Application::Dispatch subclass for this app in the lib directory under the main modules directory. routing, but cute π
π BUGS π
please report any bugs or feature requests through the web interface at <http://rt.cpan.org>. the author will be notified, and then you'll automatically be notified of progress on your bug as changes are made. closed loop communication, we love to see it π«Ά
π AUTHOR π
Gordon Van Amburg, <vanamburg at cpan.org>
π ACKNOWLEDGEMENT π
this module borrows heavily, is verily grafted from, Module::Starter::Plugin::CGIApp by Jaldhar H. Vyas, <jaldhar at braincells.com>. "verily grafted"?? the drama, the poetry, we stan πΈ
π COPYRIGHT π
this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. free as in bestie, go off π
π SEE ALSO π
CGI::Application::Structured-starterCGI::Application::StructuredCGI::ApplicationModule::Starter::Plugin::CGIApplication
and that's the whole page, bestie!! π
this was perl v5.42.0, dated 2025-07-25, and yeah β that footer is literally CGI::Ap...Starter(3) all over again, we've come full circle π¦β¨ love u, go build something iconic π
π¦ where this page comes from
- fedora 43: perl-CGI-Application-Structured-Tools 0.015-38.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-CGI-Application-Structured-Tools 0.015-38.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms