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

Hi everyone, I have a script that is using SOAP::Lite. There's an error in there somewhere but it prints out some 100+ lines of code from the page I'm connecting to with it so I never get to see what the actual error was. The CMD window only lets me go back so many lines. Any ideas on how to get the error set up so I can see it? I'm on Windows 8.

Replies are listed 'Best First'.
Re: Error line is too large for CMD window
by Corion (Patriarch) on Jun 08, 2015 at 13:02 UTC

    If your Windows helpdesk is unable to instruct you, I recommend redirecting the output of the program to a file:

    perl -w the-soap-lite-perlscript.pl >logfile.txt 2>&1

    That way, you can conveniently inspect the output of the file by opening the logfile.

Re: Error line is too large for CMD window
by marto (Cardinal) on Jun 08, 2015 at 13:06 UTC

    You can configure the command prompt to allow for more lines of scroll back, I have no idea how this is done on Windows 8. What you may want to do is just write STDERR to file, for example:

    #!/usr/bin/perl # derp.pl, an example in sloppiness use strict; use warnings; $| = 1; # disable buffering print $foo;

    run like so:

    perl derp.pl 2>error.txt

    You can then list the contents of error.txt using:

    type error.txt

    Or view it in your text editor of choice.

    Update: For further discussion see also how do i redirect STDOUT, STDIN, or STDERR to a FILE? and http://perlmaven.com/stdout-stderr-and-redirection.

Re: Error line is too large for CMD window
by VinsWorldcom (Prior) on Jun 08, 2015 at 13:00 UTC

    You can increase the scrollback buffer on Windows cmd.exe:

    1. Right click the top left title bar and select "Properties"
    2. Select "Layout" tab
    3. In the "Screen Buffer Size" section, change "Height" to a larger value. (I use 3000 for 3000 lines of scrollback.)
    4. Press "OK"