---
name: "PDL::Perldl2::PrintControl"
section: "3pm"
platform: "linux"
package: "libpdl-perldl2-perl"
version: "2.002-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/PDL::Perldl2::PrintControl"
---

# PDL::Perldl2::PrintControl(3pm)

disable default print output

## NAME

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

## SYNOPSIS

```
  pdl> $x = 3;
  3
  pdl> $_REPL->load_plugin('PDL::Perldl2::Plugin::PrintControl');
  pdl> $x;
  pdl> $_REPL->print_by_default(1);
  1
  pdl> $x;
  3
```

## DESCRIPTION

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

### print\_by\_default

By default, the `"PrintControl"` plugin sets `"print_by_default"` to 0 (false), which disables automatic printing of results. Call the print\_by\_default accessor with a 1 (true value) to enable default printing.

### 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

`"Devel::REPL"`

## AUTHOR

Chris Marshall, `"<chm at cpan dot org>"`

## COPYRIGHT AND LICENSE

Copyright (C) 2010 by Christopher Marshall

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