[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Testing a local CGI script



In article <mac-perl.v03130308b26ff45dc205@[206.251.80.73]>, Patrick Beart
<patrick@WebArchitecture.com> wrote:

>        I want to (eventually build and...) test a (Mac-)PERL CGI script on
>my local hard drive.
>
>1)      What is the mechanism or process to get the Web page to call the
>script?  If the Web page contains the usual "<FORM
>Action="http://www.domain.com/cgi-bin/script.pl" Method="POST">" tag and
>attributes, does this need to be changed for testing purposes to reference
>the local path on my hard drive (I would think so.)?

You need to use a web server--just pointing your browser to the script
won't work. (The web server knows how to call a cgi program, but the
browser doesn't. It just knows how to talk to a server.) I've used
NetPresentz for this, and it works fine (and I believe it is on the
MacPerl-book CD, and definitely elsewhere on the net). I just followed the
directions in the "Quick Start" readme with NetPresentz, and all went
smoothly.

>2)      What does the first line of PERL ("/usr/bin/perl" on for UNIX-based
>systems) need to be changed to? I thought that I read somewhere in the docs
>that it could be just "/perl" and MacPERL would pick it up.

It doesn't much matter. You can leave it out with no ill effect, or use
#!perl if you like. It's really only Unix that _needs_ this (to tell it
what app to use to run the script). The Mac (and Win) use different
mechanisms for this, so the "shebang" line isn't crucial.
-- 
__________________________________________________________________________

Jeff Clites                Online Editor           http://www.MacTech.com/
online@MacTech.com         MacTech Magazine
__________________________________________________________________________

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch