Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^4: Debugging a program

by hexcoder (Deacon)
on Jul 18, 2016 at 11:59 UTC ( #1167957=note: print w/replies, xml ) Need Help??

in reply to Re^3: Debugging a program
in thread Debugging a program

... and under Windows save it to file perldb.ini in your %HOMEDRIVE%%HOMEPATH% directory.

Then make sure to set the file attributes to read-only. That way it is safe and the debugger is happy.

Replies are listed 'Best First'.
Re^5: Debugging a program
by hexcoder (Deacon) on Feb 20, 2019 at 12:48 UTC
    With Strawberry Perl 5.26.2 (Windows 7) I got some complaints about unknown terminal window size when starting the debugger.
    Unable to get Terminal Size. The Win32 GetConsoleScreenBufferInfo call + didn't work. The COLUMNS and LINES environment variables didn't work +. at C:/Strawberry/perl/vendor/lib/Term/ReadLine/ line 410 +.

    These lines in sub afterinit take care of it:
    my ($cols, $lines) = split ' ', (grep { m{^\s*\d+\s+\d+\s}xms } `p +owershell -command "&{\$H=get-host;\$H.ui.rawui.WindowSize;}"`)[0]; $ENV{'COLUMNS'} = $cols; $ENV{'LINES'} = $lines; print "COLUMNS and LINES are set ($cols,$lines).\n";

    Powershell is used here to get the console property WindowSize. Then the environment variables COLUMNS and LINES are locally set and the module is happy.


      I'd prob do it this way:

      my( $cols, $lines ) = qx( powershell -command "&{ \$H=get-host; \$H.ui +.rawui.WindowSize.Width; \$H.ui.rawui.WindowSize.Height; }" ) =~ /(\d ++)/g;
      I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1167957]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2019-06-17 20:38 GMT
Find Nodes?
    Voting Booth?
    Is there a future for codeless software?

    Results (80 votes). Check out past polls.

    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!