neat()
DBI::neat(string[,length])
This function returns a string given as the first argument, placed in quotes, for an optional maximum length given as the second argument. It will not escape quotes within the string. If given a numeric value instead of a string, it will not return the results within quotes. It will return NULL values as undefined. Here is an example:
... my $test = "This is Russell's test!"; print "Test: " . DBI::neat($test, 24) . "\n";
Here are the results:
Test: 'This is Russell's t...'
Notice that the results are in single quotes, that the text was
truncated even though the maximum length given was enough to just
encompass the string. If a value of 25—one more than needed—had been
given, then the full text would have been displayed without ellipses.
To neaten a list of strings, use the
neat_list() function.