Re: splicing and empty rows



* Dave O <cxreg pobox com> [2003-12-17 19:41]:
while($n <= $#{$UserList->{'data'}}) {
    if ($UserList->{data}[$_][1] eq $bywhat) {
        splice @{$UserList->{'data'}}, $_, 1;
        $n--;
    }
    $n++;
}

Or with a little less wasted work:

  while($n <= $#{$UserList->{'data'}}) {
      if ($UserList->{data}[$_][1] eq $bywhat) {
          splice @{$UserList->{'data'}}, $_, 1;
          next;
      }
      $n++;
  }


But that isn't as illustrative.

-- 
Regards,
Aristotle
 
"If you can't laugh at yourself, you don't take life seriously enough."



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]