COPYRIGHT

Random Text Displayer Version 1.00
Copyright 2001 London Perl Mongers, All rights reserved

LICENSE

This script is free software; you are free to redistibute it
and/or modify it under the same terms as Perl itself.

URL

The most up to date version of this script is available from the nms
script archive at  <http://nms-cgi.sourceforge.net/>.

SUMMARY

rand_text chooses a random piece of text from a predefined set and
displays it on a webpage. It is intended to be used as a Server Side
Include program.

FILES

In this distribution, you will find four files:

rand_text.pl      - The main perl script.
random.txt        - A sample text database
README            - This file. Instructions on how to install and use 
                    rand_text.
MANIFEST          - List of files

CONFIGURATION

There are a number of variables that you can change in rand_text.pl which
alter the way that the program works.

$DEBUGGING    - This should be set to 1 whilst you are installing
                and testing the script. Once the script is live you
                should change it to 0. When set to 1, errors will
                be output to the browser. This is a security risk and
                should not be used when the script is live.

$random_file  - The path to the file containing the text to choose from. The
                file random.txt in this distribution is an example.

$delimiter    - The character sequence that separates different pieces of text
                in your text file. The default value ("\n%%\n") means that
                text is separated by two percent signs on a line by themself.
                This simulates the behaviour of the popular Unix program
                "fortune". To have a each line in the file as a new piece of
                text, set $delimiter to "\n".


INSTALLATION

rand_text is installed simply by copying the file rand_text.pl 
into your cgi-bin directory. If you don't know where your cgi-bin directory 
is, then please ask your system administrator

You may need to rename rand_text.pl to rand_text.cgi. Again, your
system administrator will know if this is the case.

You will probably need to turn on execute permissions to the file. You can
do this by running the command "chmod +x rand_text.pl" from your command
line. If you don't have command line access to your web server then there
will probably be an equivalent function in your file transfer program.

Then, edit your HTML files and wherever you want random text to appear put
the following code:

<!--#exec cgi="http://your.host.com/cgi-bin/rand_text.pl"-->

This is just an example, so be sure to insert the correct URL of your
rand_text.pl installation.

Note: As this is a "Server Side Include" you will need to ensure that your
web server has been configured to support SSI. Also, it's possible that you
may need to rename any files that include SSI calls to give them a different
extension. A common choice is .shtml. Your system administrator will be able
to help you with these details.

SUPPORT

For support of this script please email:

  <nms-cgi-support@lists.sourceforge.net>

