If the list is short, it is easier to use undef to weed out the unneeded parts and then you don't have to think about zero-based or one-based lists/arrays.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law