Re: [MacPerl-WebCGI] ASIP MacPerl Problem, Please Help!!!!
[email protected] (Bruce Van Allen) Wed, 11 Apr 2001 17:10:54 -0700
| Newsgroups | perl.macperl.webcgi |
|---|---|
| Message-ID | <p05010400b6fa86df5595@[205.179.215.44]> |
At 2:52 PM -0700 4/11/01, Robert Taft wrote: >sorry, the cgi is creating text files based on values passed in from >a HTML form. > >simple stuff like useragent string info, just to get started. > >blah blah was the URL of the error, i didnt want to type it all. > >if i press the quit button on the server whenever it comes up, I can >use my cgi like a charm. > >this is my first attempt at using MacPerl on a server, so I >apologize if this is a simple matter. > >- rob The little dialog box is a *good* sign. It comes from the way MacPerl handles CGI execution of Perl scripts in the Mac OS environment. The only time I ever need to click "Quit" is when I'm testing a script: you can't save changes while the CGI is still "running." The best ways to find out what you need to know: 1. Read David Steffen's article, "Using MacPerl for CGI Programming" in PerlMonth, issue 11 <http://www.perlmonth.com/index.html?issue=11>. 2. Search the archives of this list (macperl-webcgi). 3. Start simple so you see what happens as you add to your script. I mean "Hello, world" simple. Plus, be patient. I know from my own experience and from the periodic waves of discussion here that for most people getting local MacPerl/CGI to work was *really* frustrating, and then it fell into place and just worked and that was that. So follow David's instructions, watch your line endings, and remember to save as a MacPerl CGI file type (not just by adding the extension '.cgi') rather then text. Speaking of extensions, you'll encounter the question of '.acgi' vs. '.cgi'. The correct extension to use depends on your purposes in setting up CGI execution. If it's for an active public web site, you might have problems with '.acgi'. If it's for prototyping, or as front end for a custom Perl application (non-web), this isn't as much of an issue. Because my use was in the latter category, I took advantage of the way MacPerl worked together with BBEdit, by using a text version of my script with the '.cgi' extension AND a MacPerl CGI file with the 'acgi' extension. Don't open the .acgi version. Open and edit the text version in BBEdit, save, then check to see if the CGI is still running, and click Quit if it is, then use BBEdit's Export to CGI command to update your .acgi version. If you're lucky, the Export Save As... dialog will have the text file's filename but with the '.acgi' extension. Replace the previous one and go back to your web browser and test (the .acgi version) again. Rinse and repeat. This method ensures that you have saved your latest changes to disk even if you get the instability that can occur when you try to save changes to a MacPerl CGI file while the CGI is still running. Plus, it leaves a text version ready for whenever you want to ftp it to a UNIX or NT server where it will do its job. HTH <aside>If you notice I used the past tense above, it's because I've migrated my CGI test bed to the UNIX side of OS X, with Apache as web server and Perl 5.6 installed. Tres way. Still have plenty of uses for MacPerl, though...</aside> 1; -- - Bruce __bruce_van_allen__santa_cruz_ca__