what about perl

vic

RRRrrrRRRrrrRRrrr
ia am trying to create a cgi-bin on my os x and i don't know how, or if it's possible. and i've been trying to run some perl scripts and in the browser, instad of executing they appera aqs a text file!!! maybe iam not doing something right, how do use perl on os x? i know the script works i tried on tripod's cgi-bin, HELP!
 
Go to the command line and type

>which perl

That will tell you the path to perl (I'd tell you, but I'm at work right now).

Make sure that path is correct on the first line of your perl script.

As I was hunting around the Apache install last night I noticed that in the cgi-bin directory (under /Libraries/www ?) there is a test-cgi (or something like that). If that runs, then I'd assume its the perl path. If that doesn't run, then I'd check the Apache config files.

Hope that helps,
Mike
 
i am posting this quote from my private msg so it will help other people *thank*

CGI Perl is already set up so this is simple.

It is assumed that you have switched on web server.
Open the web server folder that is located in the Library folder that is in the hard drive.
In this folder there is a folder called CGI-Executables, The scripts go in here.
Open the Documents folder that is in the web server folder and create a new folder called cgi-bin
DO NOT PUT ANY THING IN IT. When you call a script under http you would say :-

http://localhost/cgi-bin/thescript.cgi

The scripts are locaated in the CGI-Executables folder of web server.
Things to know : -
Perl Bin :- #!/usr/bin/perl
THIS IS IMPORTANT OR THEY WILL NOT WORK
When a new file/script is placed in the web server CGI folder you have to change the file permissions
to be able to access/execute it to do this :-
Open the terminal and type the following
cd /
cd library/webserver/CGI-Executables
chmod 755 thefilename
 
anyway i thought it worked, but i can't run my cgi scripts in the browswer... sad sad
 
Oh I just got done doing this. The first step is to get them running in the already setup cgi-bin directory... Next you can start messing around with the Apache configs to make cgi's execute outside of the cgi-bin.

The cgi-bin is at /Library/WebServer/CGI-Executables and there are already two scripts in there that should work in the browser. Hit the URL as your-server-name-or-ip/cgi-bin/printenv. That should produce a list of environment variables.

To get cgi's working across your entire site you need to dig in and start editing your Apache config file at: /etc/httpd/httpd.conf (This has moved since the Public Beta)

In the [Directory "/Library/WebServer/Documents"] section you should find the Options command. You'll need to add "ExecCGI" here.

I'm certainly no Apache expert, so anyone correct me if I've make mistakes here. Basically I just followed the really excellent comments within the config file itself with a little help from the included manual (http://localhost/manual/).
 
i got perl to work, but only if i call the script through a link :-(, any embedded or scripts that need to write to a file do not seem to work, also, i get php syntax errors when i should not, slowly slowly it seems that things are starting to work, even though i'm still not where i want to be, any further help much appreciated
 
ok ladies and gentz

iffffff for a loong time you have been trying to get perl workin' (like me)

and u have tried avery single way that was posted in a forum, and it still does not work it may be because
......
processing....
.....
50% done
.....
ok yah let's get over with it !

MAC LINE BREAKS!!!

to get rid of mac line breacs in atext perl html etc etc file do this in the terminal it works!!!

type :

cd (drag and drop the dir your cgi and other shit are in)
hit return

type :

perl -pi -e 's/\r/\n/g' (drag and drop the file in question)
hit return


ps: to see whart i'm talking about type :

vi (drag and drop the file in question)
hit return

....
if u see something like M^ ore something like that , your file are INFECTED (jokes) with mac line breacks the above script convverts the files to UNIX compatible files!!
use that code on anything you plan to server remotely!! it's just safer this way!

i got this and other grat tips @ www.macosxtips.com

hope this clears some stuff!!
 
It was a pun intended lol
Its a stupid catchphrase from one of the actors/wrestlers of the WWF. :p


Admiral
 
Back
Top