Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I am trying to find the brower type using Apache2 and mod_perl. I tried HTTP_USER_AGENT and HTTP_AGENT environment variables. But i can't able to get the details.

Please suggest me to get the brower details.

Thanks in advance.

Replies are listed 'Best First'.
Re: How to find Brower name in mod_perl
by wazoox (Prior) on Nov 18, 2009 at 12:58 UTC
    I don't know anything about modperl, however it looks like you need to use Apache2::Filter and use it to extract the user agent from the headers, something like :
    $f->r->headers_in->{'User-Agent'}

    See the Modperl documentation for more information.

      You don't need filter. You use the request object, usually called $r, which you get passed in the beginning of your handler. It's what you get back from $f->r() there. If you're using ModPerl::Registry, it will also be in %ENV.
Re: How to find Brower name in mod_perl
by Anonymous Monk on Nov 18, 2009 at 18:30 UTC
    Dump %ENV, it sould be there
    use CGI(); print CGI->header, CGI->new(\%ENV)->Dump; __END__