Loading .txt files into an array

There is a debugger, but I almost never use it. When I tried it a while ago, it was often very slow. Instead of debugging, I tend to load up my files with @assert statements to find where an error originates. Actually, more commonly, I run the code through tests which check everything I expect to be true until I find what is not.

If that fails, I just paste the code into the REPL and look. This works because I have tests set up which prepare inputs for the code that fails.

As for local / global variables in a loop: that is usually only an issue when the code is run outside of a function. So I would expect this not to be the source of your troubles.