Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Apache::Request->param() failing on POSTs

by geektron (Curate)
on Jun 15, 2005 at 21:27 UTC ( [id://467065]=perlquestion: print w/replies, xml ) Need Help??

geektron has asked for the wisdom of the Perl Monks concerning the following question:

(i did find this Calls to Apache::Request's param method sometimes end the program and return no data that has a similar issue, but i don't have any closures ... just some straightforward (or so i think) access to an Apache::Request object.

the form submit mechanism is:

<form action="/admin/conference/build/pagetwo" method="get" enctype="m +ultipart/form-data" name="form1">
if i change the GET to a POST, i get no values from the following:
my $req = Apache::Request->new( $pass->{r} ); warn "debug:" . $req->param('year') . " " . $req->param('foundation') +;
i read through the perldoc *again* for Apache::Request, and the only thing i could immediately think of as being *wrong* was the lack of a call to:  $req->parse();, but i could be misunderstanding the following statement in the perldoc:
parse The parse method does the actual work of parsing the request. +It is called for you by the accessor methods, so it is not required . +....
am i incorrect in assuming that $req->param('foo') is and accessor method of $req?

Replies are listed 'Best First'.
Re: Apache::Request->param() failing on POSTs
by BaldPenguin (Friar) on Jun 15, 2005 at 23:03 UTC
    What happens if you just pull the args() off of the Apache object?
    my $formdata = $pass->{'r'}->content; warn $formdata->{'year'}." ".$formdata->{'foundation'};

    Don
    WHITEPAGES.COM | INC

    Edit by castaway: Closed small tag in signature

      i get:
      Can't use an undefined value as a HASH reference at ...

      using:

      warn "debug:" . $pass->{r}->content->{year} . " " . $pass->{r}->content->{foundation};
      which is the same, just no temp var.

      could i be missing something in my mod_perl install? that's all i can think of ...

        That could be important, Apache::Request uses that process for getting the POST content, which can only be read once. Maybe the content is already pulled somewhere. That would cause your original error and the undefined value error as well.

        How is $pass being defined?

        Don
        WHITEPAGES.COM | INC

        Edit by castaway: Closed small tag in signature

Re: Apache::Request->param() failing on POSTs
by blahblahblah (Priest) on Jun 16, 2005 at 04:28 UTC
      i'm using mod_perl 1 and apache 1.3.x (don't remember the minor number).

      i know i could use CGI, but i've been trying to make more use of the Apache::* modules.

      but, reading the reference thread, something does stick out

      It seems to me like your processes are getting corrupted by some C code or an improperly shared file handle or socket.
      -- perrin
      the "improperly shared filehandle" sticks out the most. i have a feeling my precedessor's approach to the application may be part of the problem. (with a  local *TEMPLATE stuck in one of the template loading modules)

      oh well, back to CGI

      I know the difference for me has always been the size of the files in import and usage. While CGI works, I personally find my applications work faster if I do not use it with the mod_perl. I have stuck with 1.x simply for stability so far, but have also gone to parsing my data by hand for to speed up the process and reduce the memory size of the application.

      Don
      WHITEPAGES.COM | INC

      Edit by castaway: Closed small tag in signature

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-03-29 01:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found