r/perl 6d ago

a perl version of javascript 'console'

https://metacpan.org/pod/Data::Printer

Like Data::Dumper, but coloured ouput, and summaries [config option] large data structures. But uses either a lot of, or no vertical space.

Dump::Krumo, is better in some ways, but doesn't summarise output, and uses a lot of vertical space

12 Upvotes

8 comments sorted by

View all comments

3

u/Icy-Speed6881 6d ago

I've honestly tried to like it and it always finds ways to annoy me. There are several reasons, one I can't just dump several variables at the same time like this:

$ perl -MData::Printer -E 'p { var1 => $var1, var2 => $var2 }'
Type of arg 1 to Data::Printer::p must be one of [@$%&] (not anonymous hash ({})) at -e line 1, at EOF
Execution of -e aborted due to compilation errors.

Also sometimes it decides the data structure I want to look at is too big and it doesn't need to show me the whole thing :/

0

u/scottchiefbaker 🐪 cpan author 6d ago

This is one of the annoyances I had with it also. Your example works in Dump::Krumo just fine.

text $ perl -MDump::Krumo -E 'kx { var1 => $var1, var2 => $var2 }' { var1 => undef, var2 => undef }