Francais     English
Perl Tools
Scripts CGI
       SSI Counter
       Random Img
       Random Text
       Random Link
       Redirect URL
       Text Clock
       Text Counter
       CGI Utils
Scripts PHP
HP 48
TI 92
Mini Messages
The Liste...
 Powered by


Frequently Asked Questions about FTLS's Perl Scripts

What do you know about Perl syntax :

    To configure these scripts, you should have a little Perl syntax acknowledge :
    # : is a comment tag.
    Each instruction should be end by the ; symbol.
    $DATA = 'string'; : affect 'string' to $DATA variable.
    A string could be represent with double quote (") or single quote ('), prefer to use single quote, because double quote evaluate data into, and you should use \@ or \$ if you want to display @ and $ tag.

     What is '#!/usr/bin/perl' ? Should I change it ?

    It's path to Perl interpreter, here noted for Unix system, for Windows system, use 'c:/Program Files/perl/perl.exe'. On Unix It's generally into '/usr/bin/perl' or '/usr/local/bin/perl'.

    Change it if your Perl path was different. If you don't know, contact your web administrator because if it's bad you will have a 'Internal Server Error'.

What's $DIR = '/Absolute/path/to/data_or_web_dir/' ?

    It's absolute path for your data or web directory. Generally look like '/home/web_user/your_login/htdocs/' for web directory, and '/home/web_user/your_login/data/' for data directory. I use it to know where I should read or write file.
I you don't know it contact your web administrator.
    If you can't find this information, you could use relative path from cgi-bin/ directory, using '../' to go up.
example :

if your directory structure look :
'/home/web_user/your_login/' : home directory
        'cgi-bin/' : cgi-bin directory
        'htdocs/' : web directory
        'data/' : data

$WEB_DIR = '/home/web_user/your_login/htdocs/' or $WEB_DIR='../htdocs/'
$DATA_DIR = '/home/web_user/your_login/data/' or $DATA_DIR='../data/'

What's chmod ?

    It's only used on Unix system to change file access permissions, if your web server is a Windows system, this don't exist.
    On all Unix system, each user can not do anything on the system, and each file created by one can not be changed or removed by another user, that why if you want what your file can be changer by a web user (generally named nobody), you should specify it. What why you should change file access permissions, else you could have 'Permission denied' errors messages.

    To use 'chmod', you should use 'telnet' to connect to your web host.
    To allows web users to read, write or create data files (into data directory), use 'chmod a+rw thefile' (read write for all user), and 'chmod a+rwx data_dir/'.
To allows web users to execute CGI scripts, use 'chmod a+rx *.cgi' into cgi-bin directory.

    If you can not use telnet, now many FTP program (program used to transfer your files into web server) include function to change files permissions, use it...

What is SSI ?

    SSI mind 'Server Side Include', that allow call CGI scripts into a HTML page, named with '.shtml' extend, CGI output was print were it was call.
Many web server can use it, but this options doesn't activated in default configuration, if you use your personal web server you should activate it. If your site is hosted by a web hosting company, contact your web administrator to know if you can use this options.

Where can I find other CGI Scripts Archives ?

© Copyright 2000 FTLS (Tyndiuk Frédéric). All rights reserved.
Last Update 08/03/2000 - Send all comments to webmaster@ftls.org