Skip Menu |
 
Update: The rt.cpan.org bug tracker service is no longer shutting down.

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the HTTP-BrowserDetect CPAN distribution.

Report information
The Basics
Id: 8547
Status: resolved
Priority: 0/
Queue: HTTP-BrowserDetect

People
Owner: Nobody in particular
Requestors: steve [...] purkis.ca
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.98
Fixed in: (no value)

Attachments
HTTP-BrowserDetect-0.98-warnings.patch



Subject: suppress spurios warnings
Download (untitled) / with headers
text/plain 1.9k
Hiya, I'm running into a small problem with the warning output of HTTP::BrowserDetect -- it's making the output of my test scripts difficult to read due to the number of warnings generated. This will also clutter up log files, and I'd rather avoid that if possible. For example, this program: use HTTP::BrowserDetect; my $ua = 'Internet Explorer 6 (MSIE 6; Windows XP)'; my $bd = HTTP::BrowserDetect->new; $bd->user_agent( $ua ); Produces these warnings: Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line 118. Argument "." isn't numeric in addition (+) at /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line 118. Use of uninitialized value in index at /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line 176. Use of uninitialized value in numeric eq (==) at /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line 185. Use of uninitialized value in numeric eq (==) at /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line 186. Use of uninitialized value in numeric ge (>=) at /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line 187. Use of uninitialized value in numeric eq (==) at /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line 188. Use of uninitialized value in numeric ge (>=) at /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line 189. Use of uninitialized value in numeric eq (==) at /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line 190. Use of uninitialized value in numeric ge (>=) at /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line 191. Use of uninitialized value in numeric eq (==) at /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line 192. Use of uninitialized value in string eq at /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line 370. Most of these can be avoided by making sure the vars are initialized -- see attached patch. hth, -Steve
diff -ru HTTP-BrowserDetect-0.98.orig/BrowserDetect.pm HTTP-BrowserDetect-0.98/BrowserDetect.pm --- HTTP-BrowserDetect-0.98.orig/BrowserDetect.pm Sun Nov 21 22:16:00 2004 +++ HTTP-BrowserDetect-0.98/BrowserDetect.pm Sun Nov 21 22:55:21 2004 @@ -7,7 +7,7 @@ @ISA = qw(Exporter); @EXPORT = qw(); @EXPORT_OK = qw(); -$VERSION = '0.98'; +$VERSION = '0.98_01'; # Operating Systems push @ALL_TESTS,(qw(win16 win3x win31 win95 win98 winnt windows win32 win2k winxp winme dotnet mac macosx mac68k macppc os2 unix sun sun4 sun5 suni86 irix irix5 irix6 hpux hpux9 hpux10 aix aix1 aix2 aix3 aix4 linux sco unixware mpras reliant dec sinix freebsd bsd vms x11 amiga)); @@ -115,7 +115,12 @@ } - $minor = 0+".$minor"; + # avoid spurious warnnings + $minor = 0 unless defined $minor; + $major = 0 unless defined $major; + $beta = '' unless defined $beta; + + $minor = 0 + "0.$minor"; $self->{tests} = {}; my $tests = $self->{tests}; @@ -161,7 +166,13 @@ ( [\d]* ) # Minor version nnumber is digits after first dot ( [^\s]* ) /x); - $minor = 0+".$minor"; + + # avoid spurious warnnings + $minor = 0 unless defined $minor; + $major = 0 unless defined $major; + $beta = '' unless defined $beta; + + $minor = 0 + "0.$minor"; #print "major=$major minor=$minor beta=$beta\n"; } Only in HTTP-BrowserDetect-0.98: BrowserDetect.pm~
From: fmerges [...] cpan.org
Download (untitled) / with headers
text/plain 2.4k
On Sun Nov 21 17:58:12 2004, guest wrote: Show quoted text
> Hiya, > > I'm running into a small problem with the warning output of > HTTP::BrowserDetect -- it's making the output of my test scripts > difficult to read due to the number of warnings generated. This > will also clutter up log files, and I'd rather avoid that if > possible. > > For example, this program: > > use HTTP::BrowserDetect; > my $ua = 'Internet Explorer 6 (MSIE 6; Windows XP)'; > my $bd = HTTP::BrowserDetect->new; > $bd->user_agent( $ua ); > > Produces these warnings: > > Use of uninitialized value in concatenation (.) or string at > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > 118. > Argument "." isn't numeric in addition (+) at > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > 118. > Use of uninitialized value in index at > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > 176. > Use of uninitialized value in numeric eq (==) at > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > 185. > Use of uninitialized value in numeric eq (==) at > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > 186. > Use of uninitialized value in numeric ge (>=) at > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > 187. > Use of uninitialized value in numeric eq (==) at > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > 188. > Use of uninitialized value in numeric ge (>=) at > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > 189. > Use of uninitialized value in numeric eq (==) at > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > 190. > Use of uninitialized value in numeric ge (>=) at > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > 191. > Use of uninitialized value in numeric eq (==) at > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > 192. > Use of uninitialized value in string eq at > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > 370. > > Most of these can be avoided by making sure the vars are initialized > -- see attached patch. > > hth, > -Steve
I came up with the same problems when passing in the UA string below: Links (2.1pre15; Linux 2.4.26-vc4 i586; x) Should need some refactoring... but anyway, good module.
Download (untitled) / with headers
text/plain 2.8k
On Tue Apr 18 17:29:12 2006, guest wrote: Show quoted text
> On Sun Nov 21 17:58:12 2004, guest wrote:
> > Hiya, > > > > I'm running into a small problem with the warning output of > > HTTP::BrowserDetect -- it's making the output of my test scripts > > difficult to read due to the number of warnings generated. This > > will also clutter up log files, and I'd rather avoid that if > > possible. > > > > For example, this program: > > > > use HTTP::BrowserDetect; > > my $ua = 'Internet Explorer 6 (MSIE 6; Windows XP)'; > > my $bd = HTTP::BrowserDetect->new; > > $bd->user_agent( $ua ); > > > > Produces these warnings: > > > > Use of uninitialized value in concatenation (.) or string at > > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > > 118. > > Argument "." isn't numeric in addition (+) at > > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > > 118. > > Use of uninitialized value in index at > > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > > 176. > > Use of uninitialized value in numeric eq (==) at > > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > > 185. > > Use of uninitialized value in numeric eq (==) at > > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > > 186. > > Use of uninitialized value in numeric ge (>=) at > > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > > 187. > > Use of uninitialized value in numeric eq (==) at > > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > > 188. > > Use of uninitialized value in numeric ge (>=) at > > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > > 189. > > Use of uninitialized value in numeric eq (==) at > > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > > 190. > > Use of uninitialized value in numeric ge (>=) at > > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > > 191. > > Use of uninitialized value in numeric eq (==) at > > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > > 192. > > Use of uninitialized value in string eq at > > /usr/local/lib/perl5/site_perl/5.8.4/HTTP/BrowserDetect.pm line > > 370. > > > > Most of these can be avoided by making sure the vars are initialized > > -- see attached patch. > > > > hth, > > -Steve
> > > I came up with the same problems when passing in the UA string below: > > Links (2.1pre15; Linux 2.4.26-vc4 i586; x) > > Should need some refactoring... but anyway, good module.
Hi, I'm a new co-maintainer of this module. Thanks for pointing this out. It appears to be fixed in the latest version, but I've added tests for these cases to 1.01, which will be on CPAN in the next day or so. Best, Olaf


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.