Apache::Scriptor::Simple - The simplest way to activate Apache::Scriptor.
#!/usr/local/bin/perl -w # Use "handlers" handler directory: use Apache::Scriptor::Simple; # that's all! #!/usr/local/bin/perl -w # Custom handler directory: use Apache::Scriptor::Simple("myhandlers"); # that's all!
This module is used to make the work of creation Apache handler schipt easily. See example in Apache::Scriptor module.
### File /.htaccess: # Setting up the conveyor for .htm: # "input" => eperl => s_copyright => "output" Action perl "/_Kernel/Scriptor.pl" AddHandler perl .htm Action s_copyright "/_Kernel/Scriptor.pl" AddHandler s_copyright .htm ### File /_Kernel/Scriptor.pl: #!/usr/local/bin/perl -w use Apache::Scriptor::Simple; ### File /test.htm: print "<html><body>Hello, world!</body></html>"; ### File /_Kernel/handlers/s_copyright.pl: sub s_copyright { my ($input)=@_; -f $ENV{SCRIPT_FILENAME} or return -1; # Error indicator # Adds the comment string BEFORE all the output. print '<!-- Copyright (C) by Dmitry Koterov (koterov at cpan dot org) -->\n'.$input; return 0; # OK } ### Then, user enters the URL: http://ourhost.com/test.htm. ### The result will be: Content-type: text/html\n\n <!-- Copyright (C) by Dmitry Koterov (koterov at cpan dot org) -->\n Hello, world!
Dmitry Koterov <koterov at cpan dot org>, http://www.dklab.ru
Apache::Scriptor.
Apache::Scriptor
To install Apache::Scriptor::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Apache::Scriptor::Simple
CPAN shell
perl -MCPAN -e shell install Apache::Scriptor::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.