Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

USER_AGENT

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


idel.fuschini at gmail

May 11, 2009, 4:15 AM

Post #1 of 2 (563 views)
Permalink
USER_AGENT

Hi,
I want to read the user_agent i'm using this code:

my $f = shift;
my $user_agent=$f->headers_in->{'User-Agent'};

but apache logs this error:

Can't locate object method "headers_in" via package "Apache2::Filter"

why ?


--
Idel
=====================
E-Mail: idel.fuschini [at] gmail
Web Site: http://www.idelfuschini.it
OpenSource Project: http://www.idelfuschini.it/apache-mobile-filter.html


clint at traveljury

May 11, 2009, 4:21 AM

Post #2 of 2 (517 views)
Permalink
Re: USER_AGENT [In reply to]

On Mon, 2009-05-11 at 13:15 +0200, Idel Fuschini wrote:
> Hi,
> I want to read the user_agent i'm using this code:
>
> my $f = shift;
> my $user_agent=$f->headers_in->{'User-Agent'};
>
> but apache logs this error:
>
> Can't locate object method "headers_in" via package "Apache2::Filter"

Because it's not a method of Apache2::Filter:

http://perl.apache.org/docs/2.0/api/Apache2/Filter.html


Try $f->r->headers_in->{'User-Agent'}
>
clint

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.