Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   perl - CGI problem (http://www.velocityreviews.com/forums/t908252-perl-cgi-problem.html)

Zhiliang Hu 09-02-2008 07:09 PM

perl - CGI problem
 
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. Sinan Unur 09-02-2008 07:32 PM

Re: perl - CGI problem
 
Zhiliang Hu <zhilianghu@gmail.com> wrote in news:c360f580-5dab-4794-a259-
09dbc7cbc750@56g2000hsm.googlegroups.com:

> 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 <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

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

xhoster@gmail.com 09-02-2008 07:55 PM

Re: perl - CGI problem
 
Zhiliang Hu <zhilianghu@gmail.com> wrote:
> 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.

Zhiliang Hu 09-04-2008 02:56 AM

Re: perl - CGI problem
 
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


xhoster@gmail.com 09-04-2008 10:34 AM

Re: perl - CGI problem
 
Zhiliang Hu <zhilianghu@gmail.com> wrote:
> 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.


All times are GMT. The time now is 05:09 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.