in reply to Help with perldebug

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:


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

Replies are listed 'Best First'.
Syntax error?
by alietzow (Initiate) on May 17, 2002 at 00:15 UTC
    I posted this accidentally as "Anonymous Monk"... sorry. This statement

    if ($q->param('field') eq "") {&printform()} {&results()}

    gives the error: Use of unitialized value in string eq at select.cgi line 18.
    I'm beyond "showmethemonkey" and I know my CGI's are being processed. So what is wrong with the eq statement?
      Can you post the whole program?
      I suspect the error is in the 'field'. You need the name of the field variable there ( such as name or address ). Like this:

      #!/usr/bin/perl -wT use CGI; use CGI::Carp qw( fatalsToBrowser ); if($q->param('name') eq "") { &printForm(); &results(); }

      Did you declare the fields with 'my' in your CGI app?
      -DK