Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Problem Running Perl Debugger

by roho (Monsignor)
on May 19, 2010 at 16:40 UTC ( #840731=perlquestion: print w/ replies, xml ) Need Help??
roho has asked for the wisdom of the Perl Monks concerning the following question:

I'm getting a "SetConsoleMode failed" error message when I try to use the Perl debugger. I am running ActivePerl 5.8.9 Build 827 on Windows Vista Home Premium. I get the same error on my XP machine (same Perl setup). Is this a known problem with Perl on Windows?

Versions of modules mentioned in the error message.

C:\>ppm query term-r* +--------------------+-----------+------------------------------------ +-+------+ | name | version | abstract + | area | +--------------------+-----------+------------------------------------ +-+------+ | Term-ReadKey | 2.30 | Change terminal modes and perfor... + | perl | | Term-ReadLine | 1.03 | + | perl | | Term-ReadLine-Perl | 1.0302-r1 | Readline implementation in Perl + | perl | | Term-ReadLine-Perl | 1.0303 | + | site | +--------------------+-----------+------------------------------------ +-+------+ C:\>perl -d sample.pl Loading DB routines from perl5db.pl version 1.31 Editor support available. Enter h or 'h h' for help, or 'perldoc perldebug' for more help. main::(sample.pl:9): my $x = 1; SetConsoleMode failed, LastError=|6| at C:/Perl/lib/Term/ReadKey.pm li +ne 265. at C:/Perl/site/lib/Term/ReadLine/readline.pm line 1581 readline::readline(' DB<1> ') called at C:/Perl/site/lib/Term +/ReadLine/Perl.pm line 11 Term::ReadLine::Perl::readline('Term::ReadLine::Perl=ARRAY(0x3 +62d3f0)', ' DB<1> ') called at C:/Perl/lib/perl5db.pl line 6422 DB::readline(' DB<1> ') called at C:/Perl/lib/perl5db.pl line + 2235 DB::DB called at sample.pl line 9 DB<1> x $x

"Its not how hard you work, its how much you get done."

Comment on Problem Running Perl Debugger
Download Code
Re: Problem Running Perl Debugger
by Khen1950fx (Canon) on May 19, 2010 at 20:07 UTC
    Check your environmental variables. I don't use Windows, but on my system, I use xterm, for example, TERM=xterm. Try setting it to TERM=dumb to get rid of the warning.
Re: Problem Running Perl Debugger
by SilasTheMonk (Chaplain) on May 19, 2010 at 23:56 UTC

    I don't know what is going on here, but I can spot three things that might shed light on the issue.

    1. You have two versions of Term::Readline::Perl installed. I'm not saying I cannot see reasons why that could be, but you might want to elaborate on how it came about.
    2. About 20% of tests for Term::Readline::Perl failed and there a number of bugs. I would also say "have you read the docs", but there does not seem to be any.
    3. Searching for "SetConsoleMode" through the various modules mentioned threw up this interesting snippet in Term::ReadLine
    4. # the Windows CONIN$ needs GENERIC_WRITE mode to allow # a SetConsoleMode() if we end up using Term::ReadKey open FIN, ( $^O eq 'MSWin32' && $console eq 'CONIN$' ) ? "+<$cons +ole" : "<$conso +le"; open FOUT,">$consoleOUT"; #OUT->autoflush(1); # Conflicts with debugger? my $sel = select(FOUT); $| = 1; # for DB::OUT select($sel); $ret = bless [\*FIN, \*FOUT]; } else { # Filehandles supplied $FIN = $_[2]; $FOUT = $_[3]; #OUT->autoflush(1); # Conflicts with debugger? my $sel = select($FOUT); $| = 1; # for DB::OUT select($sel); $ret = bless [$FIN, $FOUT]; }
      Have you tried posting a small piece of code that reproducibly causes the problem?
      Thanks for your reply. The reason there are two versions of Term::ReadLine::Perl is that one is core (area=perl) and the other is a more recent update from CPAN (area=site).

      Entering 'perl -d anyprogram.pl' will reproduce the error.

      "Its not how hard you work, its how much you get done."

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (16)
As of 2014-07-30 20:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (240 votes), past polls