On Thu, 25 Nov 1999, David Bovill wrote:

> > Can you write CGIs on Mac with Perl?
> 
> Course you can -:)

Figured.  What does the API look like?  That is, how do you get the
AppleEvent, and then how do you get various chunks out of it?

> ...
> 
> >> This true for global variables?
> > 
> > Nope, just for environment variables (those globals with names that
> > start with $).
> > 
> 
> So your suggestion:
> 
> > Another method to consider is to pass all of the "environment
> > variables" as a parameter array....
> 
> > cgiParams["REQUEST_METHOD"]
> 
> In perl (at least on the Mac -:) environmental variable are stored in a
> "associative array" / "hash" in perl parlance. This array is the "special
> %ENV hash, and you extract it's various components with a statement like
>  
>     print $ENV{'REQUEST_METHOD'}
> 
> How about doing this in mc as:
> 
>     put $ENV['REQUEST_METHOD']
> 
> where $ENV is an environmental variable (already used?) set by the server
> containing an associative array with all the usual cgi stuff in.
> 
> or
> 
>     put ENV["REQUEST_METHOD"]
> 
> if it is decided to use a global. We could use a longer more explicit global
> to avoid conflicts (ie mchttpdENV or dollarENV).

So the AppleEvent is completely hidden?  Or does it just come in as
one big string that some package splits up into the array (HTTP being
done with a package in Perl in all the examples I've seen)?

> Aha, go you. Start using my brain a bit more maybe -:) Now I'll have a look
> at how to get at things like CONTENT_LEGNTH when the server recieves a
> "POST" from a form. Is it the legnth of stdin, cos I couldn't see it in "the
> params". If so what happens if the server receives more stuff by the time
> the script gets to processing this?

I don't see where this is handled specially in the mchttpd scripts.
Andu?
  Scott

********************************************************
Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...

Reply via email to