Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

debug help

by vrempire (Sexton)
on Aug 03, 2000 at 09:00 UTC ( [id://25905]=perlquestion: print w/replies, xml ) Need Help??

vrempire has asked for the wisdom of the Perl Monks concerning the following question:

Hi guys,I am very new to Perl and I really need help debug the program.seems there a lot of error in my prog.When I write at command line >perl -d file.pl and press enter, I cannot read the error since it skip the previous page of error.How i want to make sure that I can read the error page by page?Thank you for attention.

Replies are listed 'Best First'.
RE: debug help
by meonkeys (Chaplain) on Aug 03, 2000 at 12:27 UTC
    Allow me to start with two assumptions:

    1.You start the Perl debugger and the first thing you see is a lot of garbage that scrolls past faster than you can read. Am I correct in assuming this?
    (If not, please ignore this reply)

    2.You are currently drinking beer brewed by Belgian monks.
    (If not, drink one and continue hacking)

    Try the following command inside after starting with ">perl -d file.pl" like you did.
    DB<1> |R

    This will restart the debugger and pipe the command through your shell's pager. This might even work in good 'ol DOS.

    You can get help in the debugger by typing
    DB<1> |h

    (I bogarted most of this from the perldebug manpage)
Re: debug help
by ColtsFoot (Chaplain) on Aug 03, 2000 at 11:04 UTC
    vrempire if you are running csh or one of its derivitives then
    you can redirect STDERR by using the following:-
    perl -d file.pl >& errors.txt
    If you just want to page through then errors the try:-
    perl -d file.pl |& more


    Hope this helps
Re: debug help
by eak (Monk) on Aug 03, 2000 at 09:25 UTC
    Try typing: perl -d file.pl 2> errors.txt This redirects STDERR to errors.txt. --eric
      eric,thanks for your concern.I have tried that,and it created a new file which is errors.txt.But when I opened it,it is blank.Is it must be something with the STDERR?If it,then what is the way I can use STDERR to make that errors print out at errors.txt?
Re: debug help
by ray (Initiate) on Aug 03, 2000 at 22:21 UTC
    Try using the -c option:
    perl -c file.pl
    If you're getting errors before the debug prompt, it's a compile time error which you'll have to fix outside the debugger. Also, wierd things can happen when you redirect the output from an interactive program.

    Later,
    Ray.

Re: debug help
by vrempire (Sexton) on Aug 03, 2000 at 13:42 UTC
    well,meonkeys.The first statement is true(1). The second statement is false(0). :) I tried the DB<1> |R and then I press enter and then here is the statement: Warning:some settings and command-line options maybe lost! and then it hang. well,what is actually happen during the process,anywhere? Thanks for your concern.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://25905]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-19 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found