
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tlug] [N00B] mod_perl2 Apache2::::Connection get_remote_host
- Date: Thu, 09 Aug 2007 17:38:38 +0900
- From: Nguyen Vu Hung <vu-hung@example.com>
- Subject: [tlug] [N00B] mod_perl2 Apache2::::Connection get_remote_host
- User-agent: Thunderbird 2.0.0.4 (Windows/20070604)
Hi all,
#I am quite ( nearly completely ) new to Perl and mod_perl2.
I wanted to get the remote host with the code:
use Apache2::Connection ();
use Apache2::RequestRec ();
my $c = $r->connection;
my $remote_host = $c->get_remote_host();
#cf. http://perl.apache.org/docs/2.0/api/Apache2/Connection.html
Details of the environment are:
Apache 2.0.52, perl 5.8, mod_perl 2.0.2, CentOS 4.5
And the error I got when I excuted this code:
[Thu Aug 09 17:06:57 2007] [error] Global symbol "$r" requires explicit
package name at /path01/www/Biz001.pm line 14564.\nBEGIN not safe after
errors--compilation aborted at /path01/www/Biz001.pm line
14581.\nCompilation failed in require at /path01/www/Foo001.pm line
17.\nBEGIN failed--compilation aborted at /path01/www/Foo001.pm line
17.\nCompilation failed in require at /path003/fbar.cgi line 19.\nBEGIN
failed--compilation aborted at /path003/fbar.cgi line 19.\n
I don't know why because arcording to Apache2::Connection API page, my
code *should* work.
Home |
Main Index |
Thread Index