Skip Menu |
 

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

Report information
The Basics
Id: 18807
Status: new
Priority: 0/
Queue: Array-Uniq

People
Owner: Nobody in particular
Requestors: bowman [...] math.utah.edu
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.02
Fixed in: (no value)



Subject: Array::Uniq doesn't handle arrays containing entries with zero values
Download (untitled) / with headers
text/plain 1.6k
The lines where $prev is checked should check to be sure that $prev is defined instead: *** Array/Uniq.pm~ Wed Aug 27 11:01:22 2003 --- Array/Uniq.pm Thu Apr 20 12:27:37 2006 *************** *** 16,22 **** my $prev = undef; my @out; foreach my $val (@_){ ! next if $prev && ($prev eq $val); $prev = $val; push(@out, $val); } --- 16,22 ---- my $prev = undef; my @out; foreach my $val (@_){ ! next if defined($prev) && ($prev eq $val); $prev = $val; push(@out, $val); } *************** *** 29,35 **** my $ins = undef; my @out; foreach my $val (@_){ ! if ($prev && $prev eq $val){ next if ($ins && $ins eq $val); push(@out, $val); $ins = $val; --- 29,35 ---- my $ins = undef; my @out; foreach my $val (@_){ ! if (defined($prev) && $prev eq $val){ next if ($ins && $ins eq $val); push(@out, $val); $ins = $val; *************** *** 47,53 **** my $ctr = 0; my @out; foreach my $val (@_){ ! if ($prev){ if ($prev eq $val){ $ctr ++; next; --- 47,53 ---- my $ctr = 0; my @out; foreach my $val (@_){ ! if (defined($prev)){ if ($prev eq $val){ $ctr ++; next;


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.