You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Adolph Torres <kh...@earthlink.net> on 2003/08/21 21:13:11 UTC

RE: ModPerl2/Apache2 - Error handling return codes - RegistryCooker.pm:"Argument "" isn't numeric ...& bottom of web page say: OK the server encounteredan internal .....

Hello Again,

 

Below is the slimmed down script (script1.pl) to reproduce the same 
error.  This script is supposed to accept form input of all types (char, 
boolean, numeric, etc).  Couple things to note:  Neither edit 
changed the error message in error_log nor prevented the OK msg from popping up 
(and I did restart httpd). Bummer.  Also, I changed the script to not 
accept input (see script2.pl) - just run through a loop and put something onto 
the screen - and that worked fine. 

 

In doing that it became apparent my problem has something to do with 
the $#in  in the foreach 
statement:          foreach $i (0 
.. $#in) { ...}

 

Lastly, to simulate the data being passed into it I added onto the 
url   

...... sec/script1.pl?First_Name=Adolph Last_Name=Torres

and found the "" in the error_log filled in with the incoming data - all of 
it as a single string apparently.

 

Thank You for the quick response - I know you guys are very busy - It was 
and is very appreciated.

Best Regards,

Adolph Torres

khmb1@earthlink.net  

 

--------------------------

script1.pl

--------------------------

#!/usr/bin/perl -w
print "Content-Type: text/html\n\n";
use 
strict;
our $in;
our $key;
our $val;
our $i;
our @listing;
our 
@in;

 

      local (*in) = @_ if 
@_;
      local ($i, $key, $val);

 

      if ( $ENV{'REQUEST_METHOD'} eq "GET" ) 
{
        $in = 
$ENV{'QUERY_STRING'};
      } elsif 
($ENV{'REQUEST_METHOD'} eq "POST") 
{
        
$in;
        
read(STDIN,$in,$ENV{'CONTENT_LENGTH'});
      } else 
{
        
$in;
            $in = 
( grep( !/^-/, @ARGV )) 
[0];
            $in 
=~ s/\\ / /g;
      
}
      @in = 
split(/ /,$in);
print  PRT1;
 HTML  BODY 
  table 
border="1" 
  
 tr  th Some /th  th Values /th  /tr 
PRT1
      
foreach $i (0 .. $#in) {
        # Convert 
plus's to spaces
        $in[$i] =~ s/\+/ 
/g;
        # Split into key and 
value.
        ($key, $val) = 
split(/=/,$in[$i],2);
print  PRT2;
        
 tr  td $key /td 
        
 td $val /td  /tr 
PRT2
}
print  PRT3;
 /table  /body  /html 
PRT3


------------------------------------

script2.pl

------------------------------------

#!/usr/bin/perl -w
print "Content-Type: text/html\n\n";
use 
strict;

 

our $i;
our @key=("1","2","3","4","5");
our 
@val=("a","b","c","d","e");

 

print  PRT1;
       table 
border="1" 
        
 tr 
        
 th Some /th  th Values /th 
PRT1
      
foreach $i (0 .. 4) {
        our @listing 
= 
($key[$i],$val[$i]);
 print  PRT2;
        
 tr  td $listing[0] /td 
        
 td $listing[1] /td  /tr 
PRT2
}
print  PRT3;
        
 /tr 
        
 /table 
 /body 
 /html 
PRT3

 

 

 



--- Original Message ----- 

From: Geoffrey 
Young  

To: Stas 
Bekman  
Cc: dev@perl.apache.org ; khmb1@earthlink.net 

Sent: 8/21/2003 5:44:56 AM 

Subject: Re: ModPerl2/Apache2 - Error 
handling return codes - RegistryCooker.pm:"Argument "" isn't numeric ...  
bottom of web page say: OK the server encounteredan internal .....







  

  unrelated, please try to change line 155 to be:

  

  my $new_status = $self- {REQ}- status($old_status || 
Apache::OK);

 

if you're going to do that it should be Apache::HTTP_OK (200).

 

--Geoff




RE: ModPerl2/Apache2 - Error handling return codes - RegistryCooker.pm:"Argument "" isn't numeric ...& bottom of web page say: OK the server encounteredan internal .....

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Thu, 21 Aug 2003, Adolph Torres wrote:

> Below is the slimmed down script (script1.pl) to reproduce
> the same error.  This script is supposed to accept form
> input of all types (char, boolean, numeric, etc).  Couple
> things to note:  Neither edit changed the error message in
> error_log nor prevented the OK msg from popping up (and I
> did restart httpd). Bummer.  Also, I changed the script to
> not accept input (see script2.pl) - just run through a
> loop and put something onto the screen - and that worked
> fine.
>
> In doing that it became apparent my problem has something to do with
> the $#in  in the foreach
> statement:          foreach $i (0 .. $#in) { ...}
[ .. ]
> --------------------------
> script1.pl
> --------------------------
> #!/usr/bin/perl -w
> print "Content-Type: text/html\n\n";
> use strict;
> our $in;
> our $key;
> our $val;
> our $i;
> our @listing;
> our
> @in;
[ ... ]
>       local (*in) = @_ if @_;

Does it help if you comment out this line?

-- 
best regards,
randy kobes

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org