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 Koteroff (koteroff@cpan.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 Koteroff (koteroff@cpan.org) -->\n Hello, world!
Dmitry Koteroff <koteroff@cpan.org>, http://www.dklab.ru
Apache::Scriptor
.