CGI::Snapp::Demo::Three - A template-free demo of CGI::Snapp using the forward() method
After installing the module, do one or both of:
Unpack the distro and copy http/cgi-bin/cgi.snapp.three.cgi to your web server's cgi-bin/ directory, and make it executable.
Then browse to http://127.0.0.1/cgi-bin/cgi.snapp.three.cgi.
Note: In order to not require users to install Starman or Plack, they have been commented out in Build.PL and Makefile.PL.
Edit httpd/cgi-bin/cgi.snapp.three.psgi and change my value for the web server's doc root from /dev/shm/html to match your set up.
/dev/shm/ is a directory provided by Debian which is actually a RAM disk, and within that my doc root is the sub-directory /dev/shm/html/.
Then, install Plack and Starman and then do one or both of:
Start starman with: starman -l 127.0.0.1:5173 --workers 1 httpd/cgi-bin/cgi.snapp.three.psgi &
Start plackup with: plackup -l 127.0.0.1:5173 httpd/cgi-bin/cgi.snapp.three.psgi &
Then, with either starman or plackup, direct your browser to hit 127.0.0.1:5173/.
These commands are copied from comments within httpd/cgi-bin/cgi.snapp.three.psgi. The value 5173 is of course just a suggestion. All demos in this series use port 5171 and up.
Shows how to use the forward() method to interrupt processing of a run mode.
The output reports which methods were and were not entered per run mode.
Also, it shows how to hook the 'forward_prerun' hook.
This module is available as a Unix-style distro (*.tgz).
See http://savage.net.au/Perl-modules/html/installing-a-module.html for help on unpacking and installing distros.
Install CGI::Snapp::Demo::Three as you would for any Perl module:
Perl
Run:
cpanm CGI::Snapp::Demo::Three
or run:
sudo cpan CGI::Snapp::Demo::Three
or unpack the distro, and then either:
perl Build.PL ./Build ./Build test sudo ./Build install
or:
perl Makefile.PL make (or dmake or nmake) make test make install
new() is called as my($app) = CGI::Snapp::Demo::Three -> new(k1 => v1, k2 => v2, ...).
new()
my($app) = CGI::Snapp::Demo::Three -> new(k1 => v1, k2 => v2, ...)
It returns a new object of type CGI::Snapp::Demo::Three.
CGI::Snapp::Demo::Three
See http/cgi-bin/cgi.snapp.three.cgi.
Runs the code which responds to HTTP requests.
Hmmm. Things to consider:
shell> perl httpd/cgi-bin/cgi.snapp.three.cgi
If that doesn't work, you're in b-i-g trouble. Keep reading for suggestions as to what to do next.
Are you using perlbrew? If so, recall that your web server will use the first line of http/cgi-bin/cgi.snapp.three.cgi to find a Perl, and that line says #!/usr/bin/env perl.
So, you'd better turn perlbrew off and install CGI::Snapp and this module under the system Perl, before trying again.
http://www.perlmonks.org/?node_id=380424.
CGI::Application
The following are all part of this set of distros:
CGI::Snapp - A almost back-compat fork of CGI::Application
CGI::Snapp::Demo::One - A template-free demo of CGI::Snapp using just 1 run mode
CGI::Snapp::Demo::Two - A template-free demo of CGI::Snapp using N run modes
CGI::Snapp::Demo::Four - A template-free demo of CGI::Snapp using Log::Handler::Plugin::DBI
CGI::Snapp::Demo::Four::Wrapper - A wrapper around CGI::Snapp::Demo::Four, to simplify using Log::Handler::Plugin::DBI
Config::Plugin::Tiny - A plugin which uses Config::Tiny
Config::Plugin::TinyManifold - A plugin which uses Config::Tiny with 1 of N sections
Data::Session - Persistent session data management
Log::Handler::Plugin::DBI - A plugin for Log::Handler using Log::Hander::Output::DBI
Log::Handler::Plugin::DBI::CreateTable - A helper for Log::Hander::Output::DBI to create your 'log' table
The file CHANGES was converted into Changelog.ini by Module::Metadata::Changes.
Version numbers < 1.00 represent development versions. From 1.00 up, they are production versions.
Email the author, or log a bug on RT:
https://rt.cpan.org/Public/Dist/Display.html?Name=CGI::Snapp::Demo::Three.
CGI::Snapp::Demo::Three was written by Ron Savage <ron@savage.net.au> in 2012.
Home page: http://savage.net.au/index.html.
Australian copyright (c) 2012, Ron Savage.
All Programs of mine are 'OSI Certified Open Source Software'; you can redistribute them and/or modify them under the terms of The Artistic License, a copy of which is available at: http://www.opensource.org/licenses/index.html
To install CGI::Snapp::Demo::Three, copy and paste the appropriate command in to your terminal.
cpanm
CPAN shell
perl -MCPAN -e shell install CGI::Snapp::Demo::Three
For more information on module installation, please visit the detailed CPAN module installation guide.