Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] [N00B] [ANS] [REC] [DOC] [HTH] [YABBA] [DABBA] [DOO] [PTHFBST] mod_perl2 Apache2::::Connection get_remote_host



Nguyen Vu Hung <vu-hung@example.com> writes:

> I wanted to get the remote host with the code:
>
> use Apache2::Connection ();
> use Apache2::RequestRec ();
> my $c = $r->connection;

> [Thu Aug 09 17:06:57 2007] [error] Global symbol "$r" requires explicit
> package name 

> I don't know why because arcording to Apache2::Connection API page, my
> code *should* work.

Not really. What you've taken from that page is a brief synopsis of how
that particular module is used - not a complete script example. It
assumes you've already set up $r pointing to the Apache request object,
perhaps using something like this:

  ...
  sub handler {
      my $r = shift;
  ...

For mod_perl basics, this doc would be a good place to start:

 http://perl.apache.org/docs/2.0/user/intro/start_fast.html

possibly followed by this one:

  http://perl.apache.org/docs/2.0/user/coding/coding.html  

I'd also recommend trying the mod_perl mailing list when you get
stuck. People there are generally very helpful toward users of all
levels.

 http://perl.apache.org/maillist/modperl.html

HTH,
//Dave



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links