separator

Take a quiz or make one of your own
Tutorial 1 - Server Side Counting
Installation:
Use your telnet program to connect to your server
  1. after logging in type in 'which perl'

    • you should get a response indicating the path on your server where perl resides
    • on my server the response is /usr/local/bin/perl
    • now look at the first line of the program, get it? i.e. make sure that the path following the '#!' on the first line is correct for your system


  2. save the program on your editor and open your ftp program.

    • connect to your host and create a subdirectory of your cgi-bin called 'thecgibin'. download the program into here.


  3. on telnet change directories the thecgibin directory and enter the command 'perl -wc article01.pl'

    • you should get the response 'article01.pl syntax ok'
    • if there are any errors check your program on your text editor against the version I've given you. another likely culprit for errors is if you ftp'd in binary mode; re-ftp in ascii mode.
    • if all else fails write me, include details of what you did and I'll try to help.


  4. now that the program's on your server and compiles cleanly, you need to set up the data file. create a subdirectory of thecgibin called 'data'.


  5. create a new file on your text editor and type the number 5 on it and save the file as article01.dat


  6. now ftp article01.dat into cgi-bin/thecgibin/data


  7. on telnet say 'perl -wT article01.pl'


Here's what I got back

Counter program beginning to processCount file has been read - old count = 5Counter program done processing - new count = 6

separator

© thecgibin.com