The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Devel::REPL::Plugin::DataPrinter - Format REPL results with Data::Printer

VERSION

version 0.007

SYNOPSIS

In your re.pl config file (usually ~/.re.pl/repl.rc):

load_plugin('DataPrinter');

That's about it. Your re.pl should now give you nicer outputs :)

CUSTOMIZATION

This plugin also provides a method dataprinter_config, which can be used to configure Data::Printer for use in Devel::REPL. For example, if you don't care for colored output:

$_REPL->dataprinter_config({
  colored => 0,
});

Or if you ask for caller_info in your .dataprinter file, but don't want it in the REPL:

$_REPL->dataprinter_config({
  caller_info => 0,
});

See "Customization" in Data::Printer for configuration options; the values provided to dataprinter_config override your .dataprinterrc. colored is on by default, and the only settings you may not override are use_prototypes and return_value. Note that dataprinter_config only applies to the printing that the REPL does; if you invoke p() in your REPL session yourself, these settings are not applied.

Devel::REPL::Plugin::DataPrinter specific customization

stringify

If the reference being printed has a stringification overloaded method and you do not want to use it by default, you can configure an override by setting the package to zero:

$_REPL->dataprinter_config({
  stringify => {
    'DateTime' => 0,
  },
});

SEE ALSO

* Devel::REPL * Devel::REPL::Plugin::DDS * Data::Printer

AUTHOR

Breno G. de Oliveira <garu@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Breno G. de Oliveira.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.