The errors you report tell you that the hash %breakpoint is not initialized properly. Because of this, @fix does not get initialized. We cannot offer any more help without more information. Try dumping the array %breakpoint right before your first foreach loop. If it does not contain exactly what you expect, you must fix that first. If the problem persists, post enough of your code that we can run it and reproduce the problem.