in reply to Re: Using Data::Printer from the Perl debugger
in thread Using Data::Printer from the Perl debugger

Thanks! Interestingly, the documentation specifies putting this into .perldb:
$DB::alias{px} = 's/px/DB::px/'; sub px { my $expr = shift; require Data::Printer; print Data::Printer::p($expr); }
Which causes $expr to be printed twice, once colorized, and once uncolorized, as one might expect. Changing that last line to
Data::Printer::p($expr);
fixes it.

Replies are listed 'Best First'.
Re^3: Using Data::Printer from the Perl debugger
by LanX (Saint) on Feb 25, 2023 at 22:33 UTC
    IMHO someone should file a bug report with both modules.

    I think one of the authors had the behavior of Data::Dump::pp() in mind which doesn't print by itself when called in a non void context.

    And the other one just copied the doc without testing.

    Cheers Rolf
    (addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
    Wikisyntax for the Monastery

      I'll be glad to, but I haven't done so before. Could you point me in the right direction?

        I found this issue and have been trying to adopt DB::Pluggable for a couple of years now. The version on CPAN is not the same as the one in github. I have a version that fixes the issue.

        https://github.com/kcaran/DB-Pluggable