perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Douglas Sims <>
Subject Confusion over Apache2::Request and Apache2::RequestRec
Date Thu, 20 Aug 2009 07:20:59 GMT
I'm confused about something and I wonder if anyone can help me to
understand what's going on.  The code shown below works fine but as I was
looking over this before changing something else I realized that it probably
shouldn't.  I'm using an Apache2::Request object to return a connection
object to get the remote_ip but the documentation for Apache2::Request
doesn't show a connection method - that's in Apache2::RequestRec.

Why does connection() work on an Apache2::Request object?




In the PerlResponseHandler:

  my $requestrec = shift if $ENV{MOD_PERL};
  my $request = Apache2::Request->new($requestrec);
  my $session = Sessions->new($request, $mysql);

{package Sessions;

  sub new {
    my $class=shift;
    my $self={};
    bless ($self, $class);



        $self->{DBH}->do('INSERT INTO failedloginattempts (username,
password, ip, session, attempttime) VALUES
'.$self->{DBH}->quote($self->{SESSION}).', NOW())');

View raw message