Manual talk:DeleteOldRevisions.inc

I believe there is a bug here.

Check for the variable old[], it's not defined outside the while loop.