[sf-perl] perl on a mac

Michael Friedman friedman at highwire.stanford.edu
Mon Nov 10 12:14:33 PST 2008


A pretty good beginner's guide to how to enable CGI on OS X's apache  
and where to store your scripts so you can run them is:
	http://www.cgi101.com/learn/connect/mac.html

Basically, you find the default httpd.conf file, turn on CGI, and then  
turn on "Personal Web Sharing".

Hrm, those instructions should be slightly changed for Leopard. Now  
it's System Preferences->Sharing->Web Sharing and httpd.conf is under / 
etc/apache2/httpd.conf, but it should be pretty straightforward with  
those two location changes.

-- Mike

On Nov 10, 2008, at 11:54 AM, Alex Feinberg wrote:

> Terminal executes the script. Terminal can't render HTML. Web
> browser can only render HTML, it can't execute scripts.
>
> You need to have a web server setup and configured to execute CGI
> scripts/mod_perl for that. How to do that will probably be beyond a
> single message, but OS X includes Apache which is the de-facto
> standard for web servers.
>
> Or you can use command redirection to test, e.g.:
>
>  perl  myscript.pl > /tmp/file.html && open /tmp/file.html
>
>    Thanks,
>
> On Monday, 10 November 2008 at 11:49:06 -0800, Walt Sanders wrote:
>> I'm new to apple machines and have had no luck getting my perl
>> programs to run.  Had no problem with my previous PC machines.  I  
>> have
>> BBEdit and Dreamweaver and Komodo, but nothing works.  Must be some
>> obvious thing that I don't know?
>>
>> Specifically, I need to run html generating perl programs on a  
>> browser
>> on my machine for testing.  All I get is the code in the browser.
>>
>> If I run perl in Terminal, it runs ok, so long as there is no html.
>> In the case of html, it just lists the code.
>>
>> Grateful for whatever, Walt.
>> _______________________________________________
>> SanFrancisco-pm mailing list
>> SanFrancisco-pm at pm.org
>> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm
> _______________________________________________
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
> http://mail.pm.org/mailman/listinfo/sanfrancisco-pm

---------------------------------------------------------------------
Michael Friedman                     HighWire Press
Phone: 650-725-1974                  Stanford University
FAX:   270-721-8034                  <friedman at highwire.stanford.edu>
---------------------------------------------------------------------




More information about the SanFrancisco-pm mailing list