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

Re: [MacPerl-WebCGI] Is there a way to run CGI scripts LOCALLYthrough a Web browser?



Tom Salmon skrev/wrote:
>I'm fairly new to Perl, however I have written a number of scripts that run
>perfectly fine from a Web server.
>
>My question is can you run CGI scripts (through a Web browser) locally on a
>Mac (or PC) without being connected to the internet (i.e. - not from a Web
>server, but from the local machine itself). This would be a great way to
>test scripts without having to make an Internet connection.
>
>If this is possible, what steps do I need to take in my Perl code (path to
>Perl, headers, etc.) to make these scripts run off my local copy of Perl in
>a Web browser. How do I set these scripts to be executable or is that even
>necessary on a a Mac? Any help would be appreciated.

The most usual way is to run a web server like personal websharing on 
your local machine, configuring TCP/IP to use whatever is available, 
I use Appletalk on my powerbook while on he road, and manual 
configuration. Write an IP number for your computer (like 
192.168.0.1) and use the same number for router address.

Your scripts will have to be saved "as cgi" from MacPerl with an 
extension of .cgi or .acgi

Headers and such should be "as usual", i.e. a Content-Type: xxx/yyy 
at the beginning, path to perl anything you like, like #!perl -w

This should get you going, but keep on asking if not.

(Anyone to write a FAQ for this mailing list?)
Christian

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org