perl - CGI problem

Discussion in 'Perl Misc' started by Zhiliang Hu, Sep 2, 2008.

  1. Zhiliang Hu

    Zhiliang Hu Guest

    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
    Zhiliang Hu, Sep 2, 2008
    #1
    1. Advertising

  2. Zhiliang Hu <> wrote in news:c360f580-5dab-4794-a259-
    :

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

    comp.lang.perl.misc guidelines on the WWW:
    http://www.rehabitation.com/clpmisc/
    A. Sinan Unur, Sep 2, 2008
    #2
    1. Advertising

  3. Zhiliang Hu

    Guest

    Zhiliang Hu <> 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.
    , Sep 2, 2008
    #3
  4. Zhiliang Hu

    Zhiliang Hu Guest

    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
    Zhiliang Hu, Sep 4, 2008
    #4
  5. Zhiliang Hu

    Guest

    Zhiliang Hu <> 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.
    , Sep 4, 2008
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jürgen Exner

    Re: CGI Perl "use CGI" statement fail

    Jürgen Exner, Jul 31, 2003, in forum: Perl
    Replies:
    0
    Views:
    1,227
    Jürgen Exner
    Jul 31, 2003
  2. praba kar

    Python-cgi or Perl-cgi script doubt

    praba kar, Jul 30, 2005, in forum: Python
    Replies:
    1
    Views:
    510
    Michael Sparks
    Jul 30, 2005
  3. excord80
    Replies:
    17
    Views:
    619
    J Kenneth King
    Jan 29, 2009
  4. shumsta
    Replies:
    1
    Views:
    246
    Fabian Pilkowski
    Jul 22, 2005
  5. kath
    Replies:
    4
    Views:
    537
    J. Gleixner
    Apr 9, 2007
Loading...

Share This Page