USER_AGENT

--0015174c43c2a992700469a1174e
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

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.com
Web Site: http://www.idelfuschini.it
OpenSource Project: http://www.idelfuschini.it/apache-mobile-filter.html

--0015174c43c2a992700469a1174e
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,<br>I want to read the user_agent i'm using this code:<br><br>=A0=A0=
=A0=A0=A0 my $f =3D shift;<br>=A0=A0=A0=A0=A0 my=A0 $user_agent=3D$f->he=
aders_in->{'User-Agent'};<br><br clear=3D"all">but apache logs t=
his error:<br><br>Can't locate object method "headers_in" via=
package "Apache2::Filter" <br>
<br>why ?<br><br><br>-- <br>Idel<br>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D<br>E-Mail: <a href=3D"mailto:idel.fuschini [at] gmail.c=
om">idel.fuschini [at] gmail.com</a><br>Web Site: <a href=3D"http://www.idelfusc=
hini.it">http://www.idelfuschini.it</a><br>
OpenSource Project: <a href=3D"http://www.idelfuschini.it/apache-mobile-fil=
ter.html">http://www.idelfuschini.it/apache-mobile-filter.ht ml</a><br>

--0015174c43c2a992700469a1174e--
Idel Fuschini [ Mo, 11 Mai 2009 13:15 ] [ ID #2000818 ]

Re: USER_AGENT

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
Clinton Gormley [ Mo, 11 Mai 2009 13:21 ] [ ID #2000819 ]
Webserver » gmane.comp.apache.mod-perl » USER_AGENT

Vorheriges Thema: Mod_perl 2 on Windows
Nächstes Thema: Apache2::URI::unescape_url