Name

neat_list( )

Synopsis

DBI::neat_list(\@strings[, length, delimiter])

This returns a list of strings given as the first argument of the function, placed in quotes, each truncated to an optional maximum length given as the second argument. An optional third argument can specify a delimiter to place between the elements of the list or array given in the first argument. A comma and a space will be used by default if no delimiter is specified.

#!/usr/bin/perl -w
use DBI;
my @test = ("This is a test.", "Another test");
print "Test: " . DBI::neat_list(\@test, 8);
exit;

Here are the results of this script:

Test: 'This is...', 'Another...'

Get MySQL in a Nutshell 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.