Name

neat

Synopsis

$str = DBI::neat($value, $maxlen);

Returns a string containing a neat (and tidy) representation of the supplied value.

Strings will be quoted, although internal quotes will not be escaped. Values known to be numeric will be unquoted. Undefined (NULL) values will be shown as undef (without quotes). Unprintable characters will be replaced by a dot (.).

For result strings longer than $maxlen, the result string will be truncated to $maxlen-4, and "...'" will be appended. If $maxlen is 0 or undef, it defaults to $DBI::neat_maxlen, which, in turn, defaults to 400.

This function is designed to format values for human consumption. It is used internally by the DBI for trace output. It should typically not be used for formatting values for database use. (See also quote.)

Get Programming the Perl DBI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.