in reply to Log a Post Request

Are you just trying to record what parameters (and values) that your script saw? Do you care if you see the original HTTP request?

Once you let CGI parse the parameters, everything you need is in the CGI object. Record what you get before you do anything else.

use CGI; my $query = CGI->new; # reads overthing log( $query ); #....the rest of your program sub log { my $q = shift; foreach my $param ( $q->param ) { #... however you want to log things my @values = $q->param( $param ); } }
Update: a stray "s" made it into my code, and it has been hunted down and terminated.
--
brian d foy <brian@stonehenge.com>
Subscribe to The Perl Review

Replies are listed 'Best First'.
Re^2: Log a Post Request
by ikegami (Patriarch) on Jan 23, 2006 at 19:39 UTC

    foreach my $param ( $q->params )
    should be
    foreach my $param ( $q->param )