Next: Running Perl on UNIX
Up: Beginning CGI Programming in
Previous: Running Perl on a
We are almost at the stage where we can run our first CGI script.
Assuming that the script checks ok for syntax and runs in MacPerl we can proceed.
On a Macintosh (and NOT UNIX) there on further step we need to do in MacPerl.
We need to create a Macintosh CGI script:
- In MacPerl simply save the file as a CGI file. Use a my_file.cgi naming
convention. The .cgi part is important.
Figure: Saving a CGI Script in MacPerl (1)
Figure: Saving a CGI Script in MacPerl (2)
Figure: Saving a CGI Script in MacPerl (3)
- You can also save the file as an Runtime Version or Droplet. These have nothing to
do with CGI Scripts but enable you crate standalone (runnable) Macintosh Applications. Perl is a
popular programming language in its own right and has a large life outside of the Web.
- Place/save the .cgi in the My Personal Web Site Folder (or sub-folders) on the
Maclab Hard Disk.
- Reference the URL for the CGI script from a FORM or directly. The
correct URL is http://macname.cs.cf.ac.uk where macname
is the name of the Macintosh you currently using. The name should be printed on a label
on the front of the machine.
For the first.pl example we have developed here. There is no need to call it
from a form so we could simple call the URL:
http://macname.cs.cf.ac.uk/first.cgi
from Netscape to test it out.
Note: Microsoft Personal Web Server must be running.
Next: Running Perl on UNIX
Up: Beginning CGI Programming in
Previous: Running Perl on a
Dave Marshall
9/28/2001