+2  A: 

You should run your application through one of Perl's debuggers.

Since you are a TK person, you could try Devel::ptkdb or you simply go for the standard Perl debugger.

innaM
Devel::ptkdb is exactly what I was looking for. Thank you.
Trueblood