Skip Menu |

This queue is for tickets about the CDB_Perl CPAN distribution.

Report information
The Basics
Id: 34028
Status: resolved
Estimated: 2 hours (120 min)
Worked: 2 hours (120 min)
Priority: 0/
Queue: CDB_Perl

People
Owner: plank [...] cpan.org
Requestors: jason [...] long.name
Cc:
AdminCc:

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



Subject: use of ($k,$v) = each(%read) doesn't seem to work right
I'm trying to iterate through all keys/values using #iterate through a CDB while(my($k,$v) = each(%read)){ #do something } in each iteration, the value of $k seems correct, but the value of $v is the same as $k, rather than being the value in the database. I tried the following patch which seems to fix the issue: --- /usr/lib/perl5/site_perl/5.8.0/CDB_Perl/Read.pm.old 2008-03-12 11:47:16.000000000 -0400 +++ /usr/lib/perl5/site_perl/5.8.0/CDB_Perl/Read.pm 2008-03-12 11:47:40.000000000 -0400 @@ -203,7 +203,7 @@ sub FETCH{ my $lkey = $self->{'tie'}->{'lastkey'}; if(defined($lkey) && $key eq $lkey){ - return $lkey; + return $self->{'tie'}->{'lastvalue'}; } my $value = $self->get_value($key);
You are right and your patch fixes the issue. A new version will be released in a matter of days with this bug fixed as well as with a test to make sure it doesn't happen again. Thank you and sorry for the dumb mistake.