Skip Menu |

This queue is for tickets about the Array-IntSpan CPAN distribution.

Report information
The Basics
Id: 61700
Status: resolved
Worked: 20 min
Priority: 0/
Queue: Array-IntSpan

People
Owner: DDUMONT [...] cpan.org
Requestors: nodine [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.001
Fixed in: (no value)



Subject: Warnings if call lookup on new object
Calling lookup on a newly created Array::IntSpan object issues warnings instead of just returning undef. It also changes the underlying data structure, which leads to further problems. Running the attached script produces: Use of uninitialized value in numeric le (<=) at /usr/local/met/releases/ty/tools/lib/perl5/site_perl/5.8.0/Array/IntSpan.pm line 409. Use of uninitialized value in numeric ge (>=) at /usr/local/met/releases/ty/tools/lib/perl5/site_perl/5.8.0/Array/IntSpan.pm line 409. Examining the data structure in the debugger: main::(/tmp/fail:2): $A = Array::IntSpan->new; DB<1> c 3 main::(/tmp/fail:3): $A->lookup(1); DB<2> x $A 0 Array::IntSpan=ARRAY(0x8135078) empty array DB<3> n Use of uninitialized value in numeric le (<=) at /usr/local/met/releases/ty/tools/lib/perl5/site_perl/5.8.0/Array/IntSpan.pm line 409. Array::IntSpan::lookup('Array::IntSpan=ARRAY(0x8135078)',1) called at /tmp/fail line 3 Use of uninitialized value in numeric ge (>=) at /usr/local/met/releases/ty/tools/lib/perl5/site_perl/5.8.0/Array/IntSpan.pm line 409. Array::IntSpan::lookup('Array::IntSpan=ARRAY(0x8135078)',1) called at /tmp/fail line 3 main::(/tmp/fail:4): 1; DB<3> x $A 0 Array::IntSpan=ARRAY(0x8135078) 0 ARRAY(0x8332bd0) empty array For example, calling $A->get_range(1,3) works fine on the original $A, but not after lookup has modified it.
Subject: fail
Download fail
application/octet-stream 64b

Message body not shown because it is not plain text.

Hello Thanks for the bug report. I've fixed lookup by returning undef if the IntSpan is empty. This avoids mucking up internal data. This fix is on its way to CPAN in Array::IntSpan v2.002 All the best.
Thanks for producing such a useful module!
Was solved. Still is solved AFAIK.