Hi Andrew.
When I ran your small code sample ( win32 machine,
ActiveState Build 631/5.6.1 ), I received the following:
Default die handler restored.
Loading DB routines from perl5db.pl version 1.07
Editor support available.
Enter h or `h h' for help, or `perldoc perldebug' for more help.
main::(test.pl:4): my $q = new CGI;
DB<1> n
Debugged program terminated. Use q to quit or R to restart,
use O inhibit_exit to avoid stopping after program termination,
h q, h R or h O to get additional info.
DB<1>
If you would rather not read the
perldebug page ( I
would suggest doing so anyway. For the educational benefits ), I recommend any one of following books:
- Beginning Perl - Simon Cozens - Wrox Press
- Programming Perl - 3rd ed. - O'Reilly
- Professional Perl Programming - Wrox Press
All three texts have a chapt. on using the perl debugger.
If you don't feel confident ( perl skill wise ), an
excellent idea would be to read
Learning Perl 3rd ed.
first. This is essentially the standard with which perl 'newbies' increase their knowledge.
My own personal knowledge of the perl debugger is limited,
it may help to think of the commands like this:
'n' allows you to see the order in which the code is being
interpreted ( first this then that, etc. ) while 's' is used to step inside.
Hope this helps,
-DK