Pitonyak::StringUtil - File and directory scanning based on regular expressions.
use Pitonyak::StringUtil
Find the maximum width of a list of elements. Each element should either be a scalar or a reference to an array.
Center the strings in the specified width. the strings are left and right padded to use the entire width. The strings are truncated to fit into the space.
compact_space(@list_of_strings)Removes the spaces from the strings.
Each string is potentially modified. Leading and trailing white space is removed. Runs of white space is turned to one space. This modifies the calling parameters.
hash_key_width($hash_reference)Determine the maximum width of the keys in this hash
hash_val_width($hash_reference)Determine the maximum width of the values in this hash
Each string has enough spaces appended end so that the
total length is $width_to_use.
The strings are not truncated to fit into the space.
num_int_digits($number)This returns the length of a number
Returns N-digit strings representing the number with leading zeros.
Modulo is used to chop the number.
If numDigits < 0, then leading negative signs are included.
Returns $value if it is defined with length greater than zero and $default if it is not.
If $default is not included, then an empty string is used for $default.
Trim all strings so that their length is not greater than
$width_to_use.
trim_space(@strings_to_format)Remove leading and trailing white space. The parameters are modified.
Each string has enough spaces prepended end so that the
total length is $width_to_use.
The strings are not truncated to fit into the space.
Attempts to print almost any object in a pretty fashion.
The $left parameter determines what is printed before each thing printed.
The $left_grow parameter determines the new $left if smart_printer() is recursively called.
the $separator is printed between each item.
A Scalar is printed.
A Hash is printed as { key => value key => value }
An Array is printed as ( value value )
Keys and values can also be references.
Each parameter is printed using smart_printer() using default parameters.
the items are printed with no initial left indent,
recursive indents using two extra spaces, and a new line for the
item separator.
Copyright 1998-2002, Andrew Pitonyak (perlboy@pitonyak.org)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Version 1.00 First release
Version 1.01 Changed internal documentation to POD