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

Re: [MacPerl-WebCGI] cgi scripts and associated files



>I have read many postings to this mailing list about wether or not files
>used by CGI scripts need to be locked and about what actually happens when
>a perl CGI script gets two simultaneous requests. However, I am unable to
>determine what the consesus is. So my questions are these.
>
>1. Do the files that my CGI script writes to and reads from need to be
>locked whilst I am reading/writing them

That depends on what you are doing :-)

>How do I do this?

No idea, sorry.  I do recall that MacPerl and Unix-family Perl use 
different commands to accomplish this and that what one can 
accomplish is different.

Hopefully someone else can answer this.

>
>2. What happens when my CGI script recieves 2 simultaneous requests? Is
>this platform specific? i.e. do the same scripts running on Unix handle
>things differently?

This is platform specific.

If you are using MacPerl, my article on MacPerl CGI programming, 
which just came out in Perl Month:
http://www.perlmonth.com/columns/mac_perl/mac_perl.html?issue=11
discusses this at some length.

Briefly, MacPerl can only do one thing at a time, the CGI glue that 
MacPerl uses when you "Save As... CGI Script" can't prevent 
overlapping calls to MacPerl, and attempting such overlapping calls 
has bad effects ranging from dropped hits to server crash.  To 
prevent this, you need to give your CGI the .cgi filename extension, 
NOT the .acgi extension, and make sure that there is only one MacPerl 
CGI on your server.  Apparently, using the .cgi filename extension 
can hurt performance with some Web server software.  Quid Pro Quo 
(available in a free form and currently supported) works fine with 
MacPerl .cgi scripts.

If you are using Perl under a Unix family OS, this is a non-issue.

-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