A CGI script will be generated by help.pl. You can manually create it too.
#!/usr/bin/perl use lib qw(/home/user/tutoperl/lib); use strict; use JSON; use DBI; use XML::LibXML; use LWP::UserAgent; use File::Find; use Data::Dumper; use URI; use URI::Escape(); use Digest::HMAC_SHA1; use MIME::Base64(); use Template; use Genelet::Dispatch; Genelet::Dispatch::run("/home/user/tutoperl/conf/config.json", "/home/user/tutoperl/lib", [qw(Table1 Table2)]); exit;
The program loads the necessary 3rd-party modules, then calls run on Genelet::Dispatch to launch CGI or FCGI. There are 4 arguments you can pass to run, in the following order:
- The full path the configuration file.
- The library path of project’s Perl classes.
- By default, we assume all the directory names under the project classes are valid components. You can rewrite it by placing specific components here as a array reference.
- 1 for FCGI and 0 for CGI, which is the default. CGI is recommended for development.
- The maximal size in bytes for uploading files. The default is 3M bytes.
- A read-only hash reference, which you can setup once and used for all the FCGI children.