Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

cgi script works until n+1 parameter

by lepetitalbert (Monsignor)
on May 27, 2008 at 10:27 UTC ( #688646=perlquestion: print w/ replies, xml ) Need Help??
lepetitalbert has asked for the wisdom of the Perl Monks concerning the following question:

Hello dear Monks

the script is structured :

if ( $mode eq 'draft') { #display an editable draft } elsif ( $mode eq 'preview' ) { #preview } elsif ( $mode eq 'create' ) { my $param_cnt = 0; # number of lines of the output print h2( "DEBUG 0 " ); foreach ( param() ) { $param_cnt++ if ( $_ =~ /concerne/ ); } print h2( "DEBUG 1 : $param_cnt" ); # goes on }

I'm on win32 apache2.2.8 activestate 5.8.8

the script works until $param_cnt = 120 and then hangs between 'DEBUG 0' and 'DEBUG 1'

I first thought about something like 'MaxParamLenght' but the parameters first go through ( $mode eq 'draft ), then through ( $mode eq 'preview' ).

Any idea ?

Have a nice day.

"There is only one good, namely knowledge, and only one evil, namely ignorance." Socrates

Comment on cgi script works until n+1 parameter
Download Code
Re: cgi script works until n+1 parameter
by MidLifeXis (Prior) on May 27, 2008 at 11:36 UTC

    I can only assume that param and h2 are from the CGI module. Is this correct?

    Are you seeing these results in the browser, or from the command line?

    If from the command line, do you have buffering turned off?

    If you do not have buffering turned on or are looking at this through the browser, you may be getting a skewed view of where the problem is.

    Search for "suffering from buffering".

    --MidLifeXis

      Hi MidLifeXis,

      Yes I'm using cgi, I see this in the browser and am not suffering from buffering.

      The 2 previous 'functions', 'draft' and 'preview' work with no problem with more lines ( bigger $param_cnt), params and output.

      Have a nice day.

      "There is only one good, namely knowledge, and only one evil, namely ignorance." Socrates

        * Does it show the same problem if you use the CGI module entirely through its $obj-> interface?

        * If you replace use CGI by use CGI::Simple, will the error go away?

        * What about Apache's URI length limit (2/4 K?)

        Regards

        mwa

Re: cgi script works until n+1 parameter
by roboticus (Canon) on May 27, 2008 at 13:08 UTC
    little albert

    One problem with simplifying a bit of code to try to make the problem easier to find is that unless it's a working example, it's hard to tell if the problem actually exists in the code presented. In this case, I don't see anything that could cause that behavior. Sorry...

    ...roboticus

      Hi mwah and roboticus,

      I found that the script hangs after my 'DEBUG 1' !?!
      How can this happen ?

      Have a nice day

      "There is only one good, namely knowledge, and only one evil, namely ignorance." Socrates
        lepetitalbert:

        Considering that the only code you show after the 'DEBUG 1' is a comment and closing brace, I'm going to have to guess that the problem lies elsewhere in your code.

        We can't diagnose what we can't see.

        ...roboticus

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://688646]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2014-08-02 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (54 votes), past polls