• Stars
    star
    92
  • Rank 362,966 (Top 8 %)
  • Language
    Perl
  • Created almost 14 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

colored pretty-print of Perl data structures and objects

Data::Printer

Coverage Status CPAN version

Data::Printer is a Perl module to pretty-print Perl data structures and objects in full color, in a way that is properly formatted to be inspected by a human.

Basic Usage:

    my $data = get_some_data_from_somewhere();
    ...
    use DDP; p $data;  # <-- pretty-prints $data's content to STDERR

See Data::Printer in action

Main features:

  • Variable dumps designed for easy parsing by the human brain, not a machine;

  • Highly customizable, from indentation size to depth level. You can even rename the exported p() function!

  • Beautiful (and customizable) colors to highlight variable dumps and make issues stand-out quickly on your console. Comes bundled with several themes for you to pick.

  • Filters for specific data structures and objects to make debugging much, much easier. Includes filters for several popular classes from CPAN like JSON::*, URI, HTTP::*, LWP, Digest::*, DBI and DBIx::Class, printing what really matters to developers debugging code. It also lets you create your own custom filters easily.

  • Lets you inspect information that's otherwise difficult to find/debug in Perl 5, like circular references, reference counting (refcount), weak/read-only information, even estimated data size - all to help you spot issues with your data like leaks without having to know a lot about internal data structures or install heavy-weight tools like Devel::Gladiator.

  • keep your custom settings on a .dataprinter file that allows different options per module being analyzed! You may also create a custom profile class with your preferences and filters and upload it to CPAN.

  • output to many different targets like files, variables or open handles (defaults to STDERR). You can send your dumps to the screen or anywhere else, and customize this setting on a per-project or even per-module basis, like print everything from Some::Module to a debug.log file with extra info, and everything else to STDERR.

  • Easy to learn, easy to master. Seriously, what you already know cover about 90% of all use cases.

  • Works on Perl 5.8 and later Because you can't control where you debug, we try our best to be compatible with all versions of Perl 5.

  • Best of all? No non-core dependencies, Zero. Nada. so don't worry about adding extra weight to your project, as Data::Printer can be easily added/removed.

Please refer to Data::Printer's complete documentation for details on how to customize the output to your needs. Or (after installation) type:

perldoc Data::Printer

To view the complete docs on your terminal.

Installation

To install this module via cpanm:

> cpanm Data::Printer

Or, at the cpan shell:

cpan> install Data::Printer

If you wish to install it manually, download and unpack the tarball and run the following commands:

perl Makefile.PL
make
make test
make install

Of course, instead of downloading the tarball you may simply clone the git repository:

$ git clone git://github.com/garu/Data-Printer.git

Thank you for using Data::Printer! Please let me know of potential issues, bugs and wishlists :)

LICENSE AND COPYRIGHT

Copyright (C) 2011-2024 Breno G. de Oliveira

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

More Repositories

1

scala-for-perl5-programmers

Scala tutorial targeted at developers with Perl 5 experience
116
star
2

tweetylicious

a Twitter-like microblogging app in just one file
Perl
63
star
3

App-Rad

Rapid (and easy!) creation of command-line applications
Perl
15
star
4

POD2-PT_BR

Brazilian portuguese translation of Perl core documentation
Perl
14
star
5

App-cpanminus-reporter

stand-alone CPAN Testers client (for cpanminus and friends)
Perl
13
star
6

Spinner

spinner game (working title)
Perl
8
star
7

Clone

recursively copy Perl datatypes
Perl
7
star
8

MojoX-Log-Log4perl

Log4perl logging for Mojo/Mojolicious apps
Perl
6
star
9

WWW-Correios-SRO

Serviço de Rastreamento de Objetos dos Correios (Brazilian Postal Object Tracking System)
Perl
6
star
10

cpanthanks

Thank a CPAN author
Perl
5
star
11

Xonitix

As much action as we could pack in one line of a terminal
C++
4
star
12

Devel-REPL-Plugin-DataPrinter

Format Devel::REPL output with Data::Printer
Perl
4
star
13

Sub-Frequency

Run code blocks according to a given probability
Perl
3
star
14

Three.js---Slides

Apresentação sobre WebGL/Three.js para o RioJS Meeting
JavaScript
3
star
15

DataFlow-Proc-DBF

dBase DBF converting processor for DataFlow
Perl
2
star
16

Log-Dispatch-SNMP

Object for logging to SNMP servers
Perl
2
star
17

Acme-CPANAuthors-Brazilian

We are brazilian CPAN authors
Perl
2
star
18

WWW-CBF

Brazilian Football Championship status
Perl
2
star
19

Net-Dimona

acesso rápido à API de print-on-demand da Dimona
Perl
2
star
20

Games-GrooveBoard

groove the dancefloor from your keyboard!
Perl
1
star
21

Net-TinyERP

Interface com a API REST do TinyERP
Perl
1
star
22

Zef-Reporter

use zef to send test reports to CPAN Testers
Perl 6
1
star
23

MooseX-Types-PIS

PIS type for Moose classes
Perl
1
star
24

Games-SavingSue

help Sue cross the street and get her candies!
Perl
1
star
25

Net-PayPal

Perl extension for PayPal's REST API
Perl
1
star
26

App-Rad-IRC

Create IRC bots in an App::Rad fashion
Perl
1
star
27

Data-Printer-Filter-ClassicRegex

print regexes the classic qr// way
Perl
1
star
28

perlsnippets

Showcase of short Perl/CPAN code snippets in JSON format
JavaScript
1
star
29

Template-AsGraph

Create a graph from Template Toolkit file
Perl
1
star
30

Locale-BR

Identifique estados brasileiros pelo código e vice-versa
Perl
1
star