Advice for moving linux script to MacPerl

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I work for a public school where I have written a web-based CGI program
in perl that runs on our Linux web server.  Another school would like
to use this program as well, but they have an OS9 server with
AppleShare IP.  I have experience with Linux and Win2000/2003 but not
with OS9.  Here is what I have done so far to help them, and the
problems I am having:

- I told them to download and install MacPerl, which they did.

- I then sent them a sample script to try out.  It is a simple perl
script (printev.cgi) that prints the environment variables.  I changed
the 'shebang' to fit the MacPerl syntax and used my text editor to save
the file in Mac format (to have the proper end of line character).  The
script looks like this:

#!perl -w

   print "Content-type: text/html\n\n";
   print "<tt>\n";
   foreach $key (sort keys(%ENV)) {
      print "$key = $ENV<p>";

- Next I had them put the file in a web-accessible folder.

- Then I entered the URL for the file in my browser.

Here's where the problems started.  The file did not get processed by
perl, but rather simply displayed in code format in the browser.  The
server did not know what to do with the file, so it just displayed it
as text.

So here's what I did next:

- I had their tech guy start up MacPerl on the server, then open my
script file in MacPerl, then do a "Save As" and save the file in the
format "CGI Script".

- When looking at the new file it appears that MacPerl put a binary
"wrapper" around the original text file.

- He replaced the old script with this new file.

- I opened the URL in my browser and perl processed the file perfectly
this time.

So here's my question... Is this what you have to do to get perl
scripts to run on an OS9 server with AppleShare IP?  If so then here's
the problem:  My entire program is over 100 individual scripts.  Will
their tech guy have to open each script one by one and resave in "CGI
Script" format?

In my experience with Linux and Win2000/2003 a perl script is always
just a text file.  There is no need for a binary wrapper to make them

Shouldn't the "shebang" just tell the web server to give the file to
MacPerl for processing, and allow me to send them all 100+ scripts as
simple text files (of course with the proper Mac end of lines)?

Thanks in advance for any help with this!  I am sorry for my lack of
Mac knowledge and look forward to being enlightened.


Re: Advice for moving linux script to MacPerl wrote in news:1110334853.242722.30470

> So here's my question... Is this what you have to do to get perl
> scripts to run on an OS9 server with AppleShare IP?

The language in which the scripts are written is irrelevant. This is a web
server configuration question. As such, you would be more likely to get
useful responses on an appropriate forum. For example,


seems like a good place to try.


Site Timeline