RE: POST method with perl module

2004-06-04 Thread Bob Showalter
Tobias Fink wrote:
> Good morning,
> 
> im trying to set up a tools module for my modperl environment.
> My function get_vars should get all passed variables with the
> following snipplet:
> 
>  if($ENV{'REQUEST_METHOD'} eq "GET"){
>   $my_data = $ENV{'QUERY_STRING'};
>  }
>  else {
>   $data_length = $ENV{'CONTENT_LENGTH'};
>   $bytes_read = read(STDIN, $my_data, $data_length); (*)
>  }
> 
> This works great in a function of a script.
> If i put the code into a seperate module (which i use in my script),
> only the GET method works, so i think there is a problem in the (*)
> line. 
> 
> So, my question: How do i capture the POST variables from within a
> module. 

Short answer: use the CGI module. Or at the very least use the Apache
request object methods for this.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: POST method with perl module

2004-06-04 Thread Wiggins d Anconia
> Good morning,
> 
> im trying to set up a tools module for my modperl environment.
> My function get_vars should get all passed variables with the following
> snipplet:
> 
>  if($ENV{'REQUEST_METHOD'} eq "GET"){
>   $my_data = $ENV{'QUERY_STRING'};
>  }
>  else {
>   $data_length = $ENV{'CONTENT_LENGTH'};
>   $bytes_read = read(STDIN, $my_data, $data_length); (*)
>  }
> 
> This works great in a function of a script.
> If i put the code into a seperate module (which i use in my script), only
> the GET method works, so i think there is a problem in the (*) line.
> 
> So, my question: How do i capture the POST variables from within a module.
> 

Um, use the CGI module or a more mod_perl friendly (if such a thing
exists) module that will already do this?

Are you exporting $my_data?  You would need to show us more of your
module, and how you are accessing into it.  Are you using 'strict' and
'warnings'?  

http://danconia.org


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




POST method with perl module

2004-06-04 Thread Tobias Fink
Good morning,

im trying to set up a tools module for my modperl environment.
My function get_vars should get all passed variables with the following
snipplet:

 if($ENV{'REQUEST_METHOD'} eq "GET"){
  $my_data = $ENV{'QUERY_STRING'};
 }
 else {
  $data_length = $ENV{'CONTENT_LENGTH'};
  $bytes_read = read(STDIN, $my_data, $data_length); (*)
 }

This works great in a function of a script.
If i put the code into a seperate module (which i use in my script), only
the GET method works, so i think there is a problem in the (*) line.

So, my question: How do i capture the POST variables from within a module.

Regards,

Tobias


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]