DEV Community

🌌 Sébastien Feugère ☔
🌌 Sébastien Feugère ☔

Posted on

Maximize Data::Printer strings length

The Perl data structures and objects pretty printer Data::Printer would trim strings longer than 4096 characters (this is the default value).

This is something that can be parameterized in the ~/.dataprinter file:

# No limit!
string_max        = 0
Enter fullscreen mode Exit fullscreen mode

This default is sensible, though, because you usually don't want the program output to fill with too much text.

It might be necessary to change this value, only in a specific place. You can pass a false value to string_max to display the whole string fields:

p $object_with_long_string_values, string_max => 0;
Enter fullscreen mode Exit fullscreen mode

More information can be found in the module Customization section, along with all the available configuration parameters.

Top comments (0)