in reply to Code won't proceed after input.

Isn't this the wrong index ? ++$AAOcc[$counter]; should it be  ++$AAOcc[$i]?