<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    SHARYANTO::String::Util - String utilities

VERSION
    version 0.23

FUNCTIONS
  trim_blank_lines($str) =&gt; STR
    Trim blank lines at the beginning and the end. Won't trim blank lines in
    the middle. Blank lines include lines with only whitespaces in them.

  ellipsis($str[, $maxlen, $ellipsis]) =&gt; STR
    Return $str unmodified if $str's length is less than $maxlen (default
    80). Otherwise cut $str to ($maxlen - length($ellipsis)) and append
    $ellipsis (default '...') at the end.

  indent($indent, $str, \%opts) =&gt; STR
    Indent every line in $str with $indent. Example:

     indent('  ', "one\ntwo\nthree") # "  one\n  two\n  three"

    %opts is optional. Known options:

    *   indent_blank_lines =&gt; BOOL (default 1)

        If set to false, does not indent blank lines (i.e., lines containing
        only zero or more whitespaces).

  linenum($str, \%opts) =&gt; STR
    Add line numbers. For example:

         1|line1
         2|line2
          |
         4|line4

    Known options:

    *   width =&gt; INT (default: 4)

    *   zeropad =&gt; BOOL (default: 0)

        If turned on, will output something like:

          0001|line1
          0002|line2
              |
          0004|line4

    *   skip_empty =&gt; BOOL (default: 1)

        If set to false, keep printing line number even if line is empty:

             1|line1
             2|line2
             3|
             4|line4

FAQ
  What is this?
    This distribution is part of SHARYANTO::Utils, a heterogenous collection
    of modules that will eventually have their own proper distributions, but
    do not yet because they are not ready for some reason or another. For
    example: alpha quality code, code not yet properly refactored, there are
    still no tests and/or documentation, I haven't decided on a proper name
    yet, etc.

    I put it on CPAN because some of my other modules (and scripts) depend
    on it. And I always like to put as much of my code in functions and
    modules (as opposed to scripts) as possible, for better reusability.

    You are free to use this, but beware that things might get moved around
    without prior warning.

    I assure you that this is not a vanity distribution :-)

SEE ALSO
    SHARYANTO::Utils

AUTHOR
    Steven Haryanto &lt;stevenharyanto@gmail.com&gt;

COPYRIGHT AND LICENSE
    This software is copyright (c) 2012 by Steven Haryanto.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

</pre></body></html>