PDL::Perldl2::Plugin::PrintControl - disable default print output


PDL documentation  | view source Contained in the PDL distribution.

Index


NAME

Top

PDL::Perldl2::Plugin::PrintControl - disable default print output

SYNOPSIS

Top

  pdl> $a = 3;
  3
  pdl> $_REPL->load_plugin('PDL::Perldl2::Plugin::PrintControl');

  pdl> $a;

  pdl> $_REPL->print_by_default(1);
  1
  pdl> $a;
  3

DESCRIPTION

Top

By default the Devel::REPL always prints the results of its evaluation. This is fine for small objects but for things like large data objects (e.g. a 100x100 matrix in PDL) the result can be hundreds of lines of output for each command.

This plugin disables the default print output and adds an attribute with accessor method print_by_default which can be used to toggle the print default on or off.

METHODS

Top

do_print

This is a convenience accessor for the print_by_default attribute. If you call this method without a value, it toggles the current setting. Otherwise, it just sets print_by_default to the value.

It is also available in the pdl2 shell as the do_print sub with the same operation but with an implicit use of $_REPL.

SEE ALSO

Top

Devel::REPL

AUTHOR

Top

Chris Marshall, <chm at cpan dot org>

COPYRIGHT AND LICENSE

Top


PDL documentation  | view source Contained in the PDL distribution.