DBI Utility Functions

The DBI package provides the DBI utility functions as well.

hash

$hash_value = DBI::hash($buffer [, $type]);

Returns a 32-bit integer value, which is the result of a hash algorithm specified by $type performed upon the buffer. A type of 0 (the default) performs a Perl 5.1 hash, with a negative result. If the type is 1, the Fowler/Noll/Vo algorithm is used.

looks_like_number

@bool = DBI::looks_like_number(@array);

Returns a Boolean array, with true for each element of the original array that looks like a number, false for each element that does not, and undef for elements that are empty or not defined.

neat

$neat_string = DBI::neat($value [, $maxlen]);

Formats and neatens the value and quotes string for display purposes, not for passing to the database server. If the maximum length is exceeded, the string will be shortened to $maxlen-4 and an ellipsis (...) will be added to the end. If $maxlen is not is not specified, then $DBI::neat_maxlen, which defaults to 400, will be used.

neat_list

  $neat_string = DBI::neat_list(\@listref [, $maxlen [, $field_sep]]);

Calls the neat() function for each element of the list and returns a string with all the elements separated by $field_sep, which defaults to a comma (,).



Mastering MySQL 4
Mastering MySQL 4
ISBN: 0782141625
EAN: 2147483647
Year: 2003
Pages: 230
Authors: Ian Gilfillan

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net