Msg#: 4223933 posted 4:02 pm on Oct 29, 2010 (gmt 0)
I am trying to implement the following code to determine the IP address of my user.
However, it seems to require a request object (my guess) I am not sure how to obtain the request object in Apache. mod_perl is installed if that is necessary. My server admin has not been much help on this.
Msg#: 4223933 posted 7:04 pm on Oct 29, 2010 (gmt 0)
your handler-routine gets the request object as the first argument, so my $req = shift; should get you the object. however, Remote-Addr is not a header. If you're using mod_perl2, try $r->connection->remote_addr->ip_get
I'm not sure if you need to load any modules, I usually load use Apache2::Connection; use Apache2::RequestRec (); use Apache2::RequestIO (); use Apache2::Const -compile => qw(OK DECLINED FORBIDDEN); use Apache2::ServerUtil (); use Apache2::RequestUtil (); use Apache2::Log; when working with mod_perl2, because I'm too lazy to figure out which ones I'll need ;)