perl - CGI problem

Z

Zhiliang Hu

I wrote a perl program that retrieves data from MySQL database and do
some complex formating to export. In the program I used some scalar
variables to hold temporary intermediate data (~2MB).

While this program works fine on command line (takes more than 10
minutes). When I adept it as a CGI program, it works only when a small
data set is selected; When larger data set is selected, it fails
without error (return a blank page on web; no error to the Apache
server error log).

I wonder what could be the problem? I suspect the internal scalar
variable may exceed some sort of internal memory limit but I really
don't know -- therefore seem advice from experts on what should I look
into?

Thanks in advance!
Zhiliang
 
A

A. Sinan Unur

I wrote a perl program that retrieves data from MySQL database and do
some complex formating to export. In the program I used some scalar
variables to hold temporary intermediate data (~2MB).

While this program works fine on command line (takes more than 10
minutes). When I adept it as a CGI program, it works only when a small
data set is selected; When larger data set is selected, it fails
without error (return a blank page on web; no error to the Apache
server error log).

I wonder what could be the problem?

See http://www.stonehenge.com/merlyn/LinuxMag/col39.html

Sinan

--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
 
X

xhoster

Zhiliang Hu said:
I wrote a perl program that retrieves data from MySQL database and do
some complex formating to export. In the program I used some scalar
variables to hold temporary intermediate data (~2MB).

While this program works fine on command line (takes more than 10
minutes). When I adept it as a CGI program, it works only when a small
data set is selected; When larger data set is selected, it fails
without error (return a blank page on web; no error to the Apache
server error log).

1st guess: The web browser is not willing to wait 10 minutes to get its
answer. It gives up with a time out.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
 
Z

Zhiliang Hu

Thank you all for the hints. So if I send the job to background and
use a "transit page" to watch (by refresh) for the finishing of the
program, I should get by. I will try that out.

Best regards,

Zhiliang
 
X

xhoster

Zhiliang Hu said:
Thank you all for the hints. So if I send the job to background and
use a "transit page" to watch (by refresh) for the finishing of the
program, I should get by. I will try that out.

Another thing to try is to have the original script print a progress
character (like "+\n") every now and then, to keep the browser mesmerized.
It is quite a bit simpler than a refreshing transit page, and often gets
the job done.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top