Yeah, i should have noticed that in the first place, your arrays are getting populated correctly, but with unexpected data (i.e. your not explicitly setting the 0's, so uptime is returning 0's to you).. so the culprit must be how uptime.pl is running. I don't have the library installed, but I'll take a gander at the code if you'd like (uptime.pl)..
or possibly post it here..
g'luck either way..