From: Jerry D. Hedden Date: Fri, 30 May 2008 12:41:41 +0000 (-0400) Subject: Thread::Queue 2.09 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e336069e0f7687b7de5b00c4f3a376b40fdfafa3;p=p5sagit%2Fp5-mst-13.2.git Thread::Queue 2.09 From: "Jerry D. Hedden" Message-ID: <1ff86f510805300941o68c1967bw31dee3e40ffa28a7@mail.gmail.com> Explicitly check for undef in args because some versions of looks_like_number(undef) return true. p4raw-id: //depot/perl@33974 --- diff --git a/lib/Thread/Queue.pm b/lib/Thread/Queue.pm index abf33ae..686d62f 100644 --- a/lib/Thread/Queue.pm +++ b/lib/Thread/Queue.pm @@ -3,7 +3,7 @@ package Thread::Queue; use strict; use warnings; -our $VERSION = '2.08'; +our $VERSION = '2.09'; use threads::shared 1.21; use Scalar::Util 1.10 qw(looks_like_number blessed reftype refaddr); @@ -168,7 +168,10 @@ sub extract $validate_index = sub { my $index = shift; - if (! looks_like_number($index) || (int($index) != $index)) { + if (! defined($index) || + ! looks_like_number($index) || + (int($index) != $index)) + { require Carp; my ($method) = (caller(1))[3]; $method =~ s/Thread::Queue:://; @@ -183,7 +186,11 @@ $validate_index = sub { $validate_count = sub { my $count = shift; - if ((! looks_like_number($count)) || (int($count) != $count) || ($count < 1)) { + if (! defined($count) || + ! looks_like_number($count) || + (int($count) != $count) || + ($count < 1)) + { require Carp; my ($method) = (caller(1))[3]; $method =~ s/Thread::Queue:://; @@ -202,7 +209,7 @@ Thread::Queue - Thread-safe queues =head1 VERSION -This document describes Thread::Queue version 2.08 +This document describes Thread::Queue version 2.09 =head1 SYNOPSIS @@ -455,7 +462,7 @@ Thread::Queue Discussion Forum on CPAN: L Annotated POD for Thread::Queue: -L +L Source repository: L