Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Using Data::Printer from the Perl debugger

by ibm1620 (Hermit)
on Feb 25, 2023 at 21:00 UTC ( [id://11150604]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-20 00:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found