Cody Pendant has asked for the wisdom of the Perl Monks concerning the following question:

I was just looking for a module to parse the User-Agent string and report on the browser.

I found HTML::ParseBrowser on CPAN, but it's about eighteen months old and doesn't mention things like OSX in the documentation, so I assume it's in need of a minor update

What's the protocol here? Write to the author? Try to hack it myself? If I think I've done it correctly, what then? All I really want is a good subroutine, which I could write myself, to change strings like

"Mozilla/5.0 (Macintosh; U; PPC; en-US; rv:0.9.4) Gecko/20011130 Netscape6/6.2.1"
into something more usable in a hurry, like "Netscape 6 (Mac)" but it raised a more interesting question when I went the "do it properly" route.
--
($_='jjjuuusssttt annootthheer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;

Replies are listed 'Best First'.
Re: When Modules Go Stale...
by Ovid (Cardinal) on May 24, 2002 at 22:10 UTC

    Similar issues were raised in this recent thread. The response by lshatzer should answer your question.

    Cheers,
    Ovid

    Update: The XP Whore :) pointed out to me that the aforementioned post also suggests sending email to P5P, which is probably not a good idea for a non-core module.

    Re: XP Whore comment:

    $pot == $kettle; # :) # And yes, he's a friend of mine

    Also, I want to thank you for taking the time to consider this. It's always good to see people helping out with Perl.

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Re: When Modules Go Stale...
by grep (Monsignor) on May 24, 2002 at 22:08 UTC
    Ovid asked this question 3 days ago. It deals with core modules, but most of suggestions will be relevant to your case.

    grep
    These are not the monks you are looking for, move along
Browser Detection (Re: When Modules Go Stale...)
by tomhukins (Curate) on May 25, 2002 at 15:22 UTC

    Other replies to your message focus on dealing with stale CPAN modules, but I'd like to pick up on the issue of browser detection:

    Whereas most modules are updated when new functionality is required, a browser detection module would ideally be updated every time a new browser, browser version, OS or OS version is released.

    To an extent, the WWW::Search modules share this problem, as does all screen scraping code. Such code tends to deal with one particular site, rather than a collection of browsers and operating systems, though.

    Microsoft's Active Server Pages (ASP) includes a browser detection facility where the code is detached from browser matching rules which are stored in a browscap.ini file. There are many third-party browscap.ini files available. This method isn't as flexible as it could be, and it's not extensible, but it's an interesting idea.

    Perhaps the ideal browser detection code would allow me to periodically pull in browser definition files from a collection of trusted sources who describe the features of each product. Some users configure their browsers to disable certain features, so if you want to build up an accurate idea of the technologies your users can access, you should probably do some server log analysis too. This is likely to be excessive for most of us, though!

    I hope it helps you figure out how to do it properly. It would be good to see a powerful browser detection system for Perl!