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

Having upgraded from 5.6.1 to 5.8.0, I find that debugger output through the pager (e.g. |x $foo) no longer works.

Any ideas?

Replies are listed 'Best First'.
Re: No debug pager
by pg (Canon) on Jan 14, 2003 at 16:41 UTC
    The pager functionality works fine with Perl 5.8.0 debug, and I use it all the time.

    What you need to do is to set environment variable PAGER from your OS/shell, BEFORE you start debug. It is too late, if you set $ENV{PAGER} after you start your debug, and it will not work.

      Thanks, but it IS set. And o pager? reports |less which works OK from the shell.

      Ah-ha! I just ran a test to check the behaviour and |h h worked! However, that was on a normal perl script. Trying it again on the (cgi) script I was working on and no output appeared.

      Not a problem now, but I'd like to understand what's happening. So, cutting it down to the simplest, I have two files 'test.pl' is the normal script and 'sql.pl' is the cgi one. They both comprise

      #!/usr/bin/perl
      use strict;
      use warnings;
      

      The both sit in /srv/www/cgi-bin/ (which SuSE 8.1 has handled by mod-perl, but perl wouldn't know that, would it?). The difference is that sql.pl has been cut down from the cgi script that wouldn't page and test.pl has been copied across from /usr/local/bin. Yet

      perl -d sql.pl
      ...
      DB<1> |h h
      

      still produces no output, while the same treatment of test.pl pages the help OK. If both files are copied to another directory, the problem disappears.

      How come perl is picky about that one file? Did the CGI module or mod_perl do something to the output stream? I know mod_perl produces curious effects, but surely I'm not using mod_perl from the perl debugger, especially once 'use CGI' etc. are removed?

      CGI programming is certainly different from what I expected. If it means anything, fatalsToBrowser wouldn't do anything either.