<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt">This seems to be a web server configuration problem.<br>I am not very familiar with OS X stock configuration.<br><br>If you are running Apache v2.2.x add something similar to the following to the httpd.conf file:<br><br><p>&lt;Directory "/usr/local/apache2/cgi-bin"&gt;</p>

<p>&nbsp;&nbsp;&nbsp; AllowOverride None</p>

<p>&nbsp;&nbsp;&nbsp; Options +ExecCGI</p>

<p>&nbsp;&nbsp;&nbsp; Order allow,deny</p>

<p>&nbsp;&nbsp;&nbsp; Allow from all</p>

<p>&lt;/Directory&gt;</p><p><br></p><p>"/usr/local/apache2/cgi-bin" needs to be set to your specific cgi-bin directory.</p><p><br></p><p>Also, you will probably want this to be the last &lt;Directory&gt; clause in your configuration file.</p><p><br></p><p>The key option here is the 'Options +ExecCGI'.</p><p>See the Apache documentation for more information: http://httpd.apache.org/docs/2.2/mod/core.html#directory</p><p><br></p><p>Note, don't forget to restart Apache after making the changes.</p><p><br></p><p>-Darin<br></p><br><div>&nbsp;</div>Not a shred of evidence exists in favor of the idea that life is serious.<br>- Brendan Gill<div><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Walt Sanders &lt;wsanders@pacificwebdesign.org&gt;<br><b><span
 style="font-weight: bold;">To:</span></b> Dan Lyke &lt;danlyke@flutterby.com&gt;<br><b><span style="font-weight: bold;">Cc:</span></b> San Francisco Perl Mongers User Group &lt;sanfrancisco-pm@pm.org&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Sunday, November 16, 2008 10:15:46 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [sf-perl] perl on a mac<br></font><br>
You quite right about the newbie bit, although I've written dozens of perl programs and have many websites using them, it has always been "get the job done" and 'someday' I'll master the sophistication.&nbsp; This always worked on my PCs, but this Mac thing has me stopped cold.<br><br>Here is the top bit of output from Terminal:<br><br>-----------------------------<br>Rang:desktop Rang$ perl idpass.cgi<br>Content-Type: text/html; charset=ISO-8859-1<br><br>&lt;!DOCTYPE html<br>&nbsp;&nbsp;&nbsp; PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"<br>&nbsp;&nbsp;&nbsp;  "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"&gt;<br>&lt;html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>" lang="en-US" xml:lang="en-US"&gt;<br>&lt;head&gt;<br>&lt;title&gt;ID Yourself&lt;/title&gt;<br>&lt;meta http-equiv="Content-Type"
 content="text/html; charset=iso-8859-1" /&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;body bgcolor='#00ffff' onLoad='<a target="_blank" href="http://document.regform.name.fo">document.regform.name</a>.focus();'&gt;&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;table width='650' cellspacing='0' cellpadding='0' border='0' align='center'&gt;&lt;tr&gt;&lt;td&gt;&lt;center&gt;&lt;a href='indexcm.html'&gt;&lt;font size='2' color='#ff0000'&gt;&lt;b&gt;Return&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/center&gt;&lt;p /&gt;&lt;center&gt;&lt;font size='4'&gt;&lt;b&gt;Member's Personal Site Registration&lt;/b&gt;&lt;/font&gt;&lt;/center&gt;&lt;p /&gt;&lt;center&gt;&lt;font size='2' color='#ff0000'&gt;&lt;b&gt;(&amp;nbsp;Please read and follow these instructions carefully!&amp;nbsp;)&lt;/b&gt;&lt;/font&gt;&lt;/center&gt;&lt;p /&gt;<br><br>etc.<br>------------------------------<br><br><br>The html is mostly done with print commands or with &gt;&gt; sections.&nbsp; Here is the
 toping:<br><br>-----------------------<br>#!/usr/bin/perl<br>use strict;<br>use CGI qw( :standard );<br>use Fcntl qw( :flock );<br><br>print( header() );<br>print( start_html( 'ID Yourself' ) );<br><br>print("&lt;body bgcolor='#00ffff' onLoad='document.regform.name.focus();'&gt;");<br>print("&lt;p&gt;&lt;br&gt;&lt;br&gt;");<br><br>etc.<br>------------------------------<br><br><br>All rather simple minded, but it works fine everywhere if I don't try it on my Mac!&nbsp; If I run something without html, like<br><br>&nbsp; &nbsp;  #!/usr/bin/perl -w<br>&nbsp; &nbsp;  print "Content-type: text/html\n\n";<br>&nbsp; &nbsp;  print "Hello, world";<br><br>it works just fine.&nbsp; I get just the two lines printed.<br><br>Walt.<br><br><br><br><br>On Sunday, at , Dan Lyke wrote:<br><br>&gt; On Sun, 16 Nov 2008 07:22:21 -0800<br>&gt; Walt Sanders &lt;<a ymailto="mailto:wsanders@pacificwebdesign.org"
 href="mailto:wsanders@pacificwebdesign.org">wsanders@pacificwebdesign.org</a>&gt; wrote:<br>&gt;&gt; Terminal won't run it of course, it just spits that code back at<br>&gt;&gt; me. But, if I try to run it in a browser, of try to preview it in an<br>&gt;&gt; editor, it still spits code back at me.&nbsp; This is any program that<br>&gt;&gt; runs perfectly fine when I upload it to any one of my ISP servers.<br>&gt; <br>&gt; Right. You need to either:<br>&gt; <br>&gt; 1. Pipe the output to an html file (although you'll need to strip the<br>&gt; "Content-Type: text/html\n\n" first two lines). For instance:<br>&gt; <br>&gt;&nbsp;  stuff.cgi &gt; output.html<br>&gt;&nbsp;  perl -npi.bak -e 's/^Content-Type: .*$//;' output.html<br>&gt; <br>&gt;&nbsp;  And then open output.html in your web browser. If this is a Mac, you<br>&gt;&nbsp;  could do "open output.html", on a Gnome based Linux machine, you'd<br>&gt;&nbsp;  do "gnome-open output.html". Or, in either
 machine (or even Windows),<br>&gt;&nbsp;  you can have that folder opened and double-click on output.html.<br>&gt; <br>&gt; 2. Run this under a web server on your local machine.<br>&gt; <br>&gt;&gt; I can just download any working .cgi or .pl from one of my<br>&gt;&gt; websites and it won't run on my machine.<br>&gt; <br>&gt; When you say "won't run", what's the *exact* (copied and pasted) output<br>&gt; you get from one of these programs. Does it look like:<br>&gt; <br>&gt; danlyke@danhplaptop:~$ ./test.pl<br>&gt; bash: ./test.pl: /usr/share/perl: bad interpreter: No such file or<br>&gt; directory danlyke@danhplaptop:~$<br>&gt; <br>&gt; If so, then the Perl interpreter on your web server is in a different<br>&gt; place than on your Mac. However, it's fairly clear that you're a<br>&gt; relative newbie (no harm in that, just gotta be more specific), so<br>&gt; phrases like "Doesn't work" and "won't run" don't help us to debug the<br>&gt; problem for
 you.<br>&gt; <br>&gt; Dan<br><br>_______________________________________________<br>SanFrancisco-pm mailing list<br><a ymailto="mailto:SanFrancisco-pm@pm.org" href="mailto:SanFrancisco-pm@pm.org">SanFrancisco-pm@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/sanfrancisco-pm" target="_blank">http://mail.pm.org/mailman/listinfo/sanfrancisco-pm</a><br></div></div></div></body></html>