Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Problems starting the debugger

by morelenmir (Beadle)
on May 20, 2018 at 01:58 UTC ( [id://1214933]=perlquestion: print w/replies, xml ) Need Help??

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

Hey Guys!

I am in the process of getting back in to Perl after being away from programming as a whole for quite a while. I thought this might be a good time to learn how to use the built-in debugger. Previously I ran 'EPIC' inside 'Eclipse', but ended up very much disliking that IDE. Therefore this time around I intend to write programmes in a text editor called 'EditPad Pro' and then employ the native Perl debugger as necessary. Unfortunately I have run in to some problems straight out of the gate,

As a test I started with the simplest of all one-line programmes, saved as 'debug_test.pl':

say "Hello";

Next, at the console window I used the command:

perl -d debug_test.pl

This is the output I received from Perl:

Loading DB routines from perl5db.pl version 1.51 Editor support available. Enter h or 'h h' for help, or 'perldoc perldebug' for more help. <main::(test.plx:1): print "hello"; Unable to get Terminal Size. The Win32 GetConsoleScreenBufferInfo call + didn't work. The COLUMNS and LINES environment variables didn't work +. at C:/StrawberryPERL/perl/vendor/lib/Term/ReadLine/readline.pm line 41 +0. at C:/StrawberryPERL/perl/vendor/lib/Term/ReadKey.pm line 462. Term::ReadKey::GetTerminalSize(GLOB(0x28025f4)) called at C:/S +trawberryPERL/perl/vendor/lib/Term/ReadLine/readline.pm line 410 readline::get_window_size called at C:/StrawberryPERL/perl/ven +dor/lib/Term/ReadLine/readline.pm line 1114 readline::init called at C:/StrawberryPERL/perl/vendor/lib/Ter +m/ReadLine/readline.pm line 208 require Term/ReadLine/readline.pm called at C:/StrawberryPERL/ +perl/vendor/lib/Term/ReadLine/Perl.pm line 63 eval {...} called at C:/StrawberryPERL/perl/vendor/lib/Term/Re +adLine/Perl.pm line 63 Term::ReadLine::Perl::new("Term::ReadLine", "perldb", GLOB(0x2 +8b27bc), GLOB(0x28025f4)) called at C:/StrawberryPERL/perl/lib/perl5d +b.pl line 6868 DB::setterm() called at C:/StrawberryPERL/perl/lib/perl5db.pl +line 1849 DB::_DB__read_next_cmd(undef) called at C:/StrawberryPERL/perl +/lib/perl5db.pl line 2786 DB::DB called at test.plx line 1 SetConsoleMode failed, LastError=|6| at C:/StrawberryPERL/perl/vendor/ +lib/Term/ReadKey.pm line 346. at C:/StrawberryPERL/perl/vendor/lib/Term/ReadLine/readline.pm line 1 +581. readline::readline(" DB<1> ") called at C:/StrawberryPERL/per +l/vendor/lib/Term/ReadLine/Perl.pm line 11 Term::ReadLine::Perl::readline(Term::ReadLine::Perl=ARRAY(0x61 +1b1c), " DB<1> ") called at C:/StrawberryPERL/perl/lib/perl5db.pl li +ne 7367 DB::readline(" DB<1> ") called at C:/StrawberryPERL/perl/lib/ +perl5db.pl line 1858 DB::_DB__read_next_cmd(undef) called at C:/StrawberryPERL/perl +/lib/perl5db.pl line 2786 DB::DB called at test.plx line 1

I am using a fresh install of the newest Strawberry Perl (32Bit), which is release 5.26.2.1. I run this in Windows 7 (64Bit), patched with the latest updates. For what it is worth the same error occurs if I try the 64Bit edition of Strawberry Perl either. Other than this, Perl programmes themselves run without any problem. It is only when I try to execute them under the native debugger that I encounter an issue.

Can any of you chaps suggest a solution for this?

A quick search of the forum came up with a very similar issue reported by 'Ovid' way back in 2007. However that gentleman encountered the error while employing something called 'Prove', which I have never come across before and is certainly not something I am using myself. I think most of the suggestions in that thread related to using 'Prove', so I do not know how to apply them in my own far simpler situation.

UPDATE:

Well... A degree more persistence with the search function, both here and over at Google suggested another approach to sort this out that was not centred on 'Prove'; create an environment variable 'TERM' and set its value to 'dumb' (case sensitive for each I believe). After doing so perl -d debug_test.pl began working like a charm!!! So... I guess that is the fix. Which is good of course, but I have no idea why I couldn't find that result the first half-dozen times I searched for an answer... Weird indeed. Still. The jobs a good'un--problem solved!

"Aure Entuluva!" - Hurin Thalion at the Nirnaeth Arnoediad.

Replies are listed 'Best First'.
Re: Problems starting the debugger
by haukex (Archbishop) on May 20, 2018 at 09:03 UTC

      Many thanks indeed haukex!!! I will check those threads out next.

      It was so weird I couldn't find the same list of posts when I searched at first. I think it may have been a stale browser cache or something. Either that or I had transcribed the error message wrongly but my eyes glazed over the inaccuracy.

      In regards the 'TERM' environment variable; is that a new thing? I have dabbled with the debugger a very little in the past and it never came up with that error before. I am pretty sure I didn't have 'dumb' set on those occasions.

      Anyway--all's well that ends better!!!

      "Aure Entuluva!" - Hurin Thalion at the Nirnaeth Arnoediad.
        In regards the 'TERM' environment variable; is that a new thing?

        The variable itself is AFAIK not new, I think it's been around on *NIX systems for a long time, but not on Windows. But since many *NIX tools have been ported to Windows nowadays, they often still expect the common *NIX environment variables to be around.

        I am pretty sure I didn't have 'dumb' set on those occasions.

        I don't know, either the issue just didn't exist before, or it might have been set for you by a batch file like Strawberry Perl's portableshell.bat - in this node, Athanasius mentioned that Strawberry Perl 5.18.2 did set TERM=dumb, while 5.20.0 did set TERM=.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-19 12:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found