This piece of code:
@timestamps = sort (@timestamps); $unique[0] = $timestamps[0]; foreach my $stamp(@timestamps) { unless ($stamp eq $unique[$counter]) { push (@unique, $stamp); $counter++; } }
looks like you're trying to copy the unique elements of @timestamps into @unique. I'd do that like this:
my %unique; @unique{@timestamps} = (); my @unique = keys %unique;
Blessed Be
The Pixel
In reply to Re: Slow but it works
by pixel
in thread Slow but it works
by scottstef
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |