in reply to Debugging a program

You are looking for the Perl debugger, which you can learn about at perldoc perldebug or perldoc perldebtut for the tutorial. It lets you step through your code as you discuss and poke around inside variables and such (and much more)

I have to admit, though, that I'm a print and Dumper guy myself.