http://www.perlmonks.org?node_id=872304


in reply to Need to turn off prints from module

Thank you all again!

Ken, thanks for pointing out that your user agents have spaces instead of plusses. Im grabbing my strings from the server logs, and it looks like the user agent strings are being modified by the script that's producing these logs. Changing plusses to spaces helped greatly, but there are still occasional errors like:
Use of uninitialized value in split at /usr/local/share/perl/5.8.8/Par +se/HTTP/UserAgent.pm line 98, <FILES> line 14.
and
Version string '3.5.9-1.fc11' contains invalid data; ignoring: '-1.fc11' at /usr/local/share/perl/5.8.8/Parse/HTTP/UserAgent.pm line 210, <FILES> line 181.

However, making the plusses into spaces allowed the two other modules that i mentioned to make more sense out of the user agent strings that i was passing. And neither of them are giving me the annoying notifications :o) So i will probably end up using one of these as opposed to Parse::HTTP::UserAgent since there seems to be no easy way to shut the module up. And yes, like i said at the beginning, turning off all errors and warnings is not an option for a sensible programmer.

Thargas, thank you for bringing up a good point that user agent strings are not a science, that im never gonna get a 100% accurate result, and that the accuracy is going to drop as the time goes by. To answer your question, we want to see a statistics of which browsers our clients are using to reach our website so we could make business decisions on which browsers we should start/continue to provide support for. Luckily, our management understands that the report is going to have an approximation of what browsers are being used and they still see a value in such report. If you see a different approach to better achieve this goal i would love to hear your ideas!