Quote:
Is there a way to check a script for bugs?


yes, you run the script , and supply it with test data and see if the results of those tests are as expected.

I know thats not what you wanted to here, but thats the only real way.