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

Since I prefer Mozilla and Opera for browsing, it is only natural that the pages I design (with CSS)are tested on them. If I fudge my web page layout for IE, which most site visitors still unfortunately use, it throws off the layout in my preferred browsers. Since I'm using a mod_perl based template system, I can easily get the %ENV hash of the request, and deduce the UA string. What I thought would be simple is a real mess! (Just look here: <a href="http://www.pgts.com.au/pgtsj/pgtsj0212d.html"> Agent String Switchboard</a> if you haven't had a taste of this chaos yet). Does any know of a parser for these UA strings, or should I just give up and play some javascript tricks?

Replies are listed 'Best First'.
Re: User Agent differentiation
by adrianh (Chancellor) on Aug 10, 2004 at 00:21 UTC
      I'm glad I didn't spend a day hacking a regex for that. The modules look very complete. I'll give 'em a try! Thanks.
Re: User Agent differentiation
by Jaap (Curate) on Aug 10, 2004 at 09:30 UTC
    Although i know it's very tempting to write separate code for IE/The rest, it would not recommend it. Here's my tip: make your layout as simple as possible, using CSS. Develop in Mozilla, then make it work in IE too. In the end, maintainability is poor when you have separate stuff for different browsers.
Re: User Agent differentiation
by tinita (Parson) on Aug 11, 2004 at 10:22 UTC