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

Re: [MacPerl-WebCGI] Okey..what next?



At 10:15 PM -0800 3/19/00, Alvy wrote:

>Well...as you suggested, i downloaded BBedit and when i try to open the cgi
>files in BBedit, the doc is empty..

That is:
   * as expected in any case,
   * means nothing,
   * was the wrong thing to do, but probably no harm done.

Let's start from the top:

1) Any files used as data or script files by MacPerl must be 
Macintosh text files, e.g. they must use carriage returns as 
newlines.  A Unix text file will not work because it uses linefeeds 
as newlines and must be converted.  A P.C. text file will not work 
because it uses the carrriage return-line feed two character 
combination as a newline.  Conversion between different formats of 
text file can be and frequently is done during transfer, but must be 
done somehow.

2) To run as a CGI on a Mac, a MacPerl script must be saved as "CGI Script".

3) A "CGI Script" is not a text file of any kind.  It will not work 
on Unix, it cannot in general be edited by a text editor, etc.

4) If your CGI Script "require"s any Perl libraries (foobar.pl) or 
"use"s any Perl modules (foobar.pm), these should NOT be saved as CGI 
Script, but rather as Plain Text.  In fact, if they are Macintosh 
text files (see 1) there is no reason to open them in MacPerl at all.

Now what?

1) If the only copy you still have of your CGI Script is a "CGI 
Script", open in in MacPerl, and Save As... "Plain Text".  If you 
saved an original copy, use that.  If you can download it again, do 
that.

2) This applies to all modules and libraries as well.  If you have 
saved them as "CGI Script", do 1).

3) Open these with BBEdit lite.  They should look like Perl.  If they 
don't, something is so wrong you shouldn't proceed.

4) Now, from BBEdit lite, do Save As..., AND BEFORE YOU SAVE, there 
should be an [Options] button in the dialog box.  Click that, and in 
the resulting window, set the line ends from whatever they are to 
Macintosh.  Do your save.

5) For any perl libraries or modules, you are done.  Do nothing further.

6) For the actual CGI, the file listed in your URL that your web 
browser is going to call, open it in MacPerl, do a Save As as "CGI 
Script" and name it with the .cgi filename extension.

Hope this helps.

-David-



David Steffen, Ph.D.
President, Biomedical Computing, Inc. <http://www.biomedcomp.com/>
Phone: (713) 610-9770 FAX: (713) 610-9769 E-mail: steffen@biomedcomp.com

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