NAME

Indent::Block - Class for block indenting.

SYNOPSIS

use Indent::Block;
my $i = Indent::Block->new(%parameters);
print $i->indent($data, [$act_indent, $non_indent]);

METHODS

new(%parameters)
Constructor.
  • line_size

    Sets indent line size value.
    Default value is 'line_size' => 79.
  • next_indent

    Sets next indent string.
    Default value is 'next_indent' => "\t" (tabelator).
  • output_separator

    Sets output separator between indented datas for string context.
    Default value is 'output_separator' => "\n" (new line).
  • strict

    Sets or unsets strict mode.
    Unset strict mode means whitespace optimalization.
    Default value is 'strict' => 1.
indent($data_ar, [$act_indent, $non_indent])
Indent method.
- $data_ar - Reference to array with strings to indent.
- $act_indent - String to actual indent.
- $non_indent - Flag, that says 'no-indent' for current time.

ERRORS

new():
        From Class::Utils::set_params():
                Unknown parameter '%s'.
        From Indent::Utils::line_size_check():
                'line_size' parameter must be a positive number.
                        line_size => %s

EXAMPLE

 # Pragmas.
 use strict;
 use warnings;

 # Modules.
 use Indent::Block;

 # Object.
 my $i = Indent::Block->new(
         'line_size' => 2,
	 'next_indent' => '',
 );

 # Print in scalar context.
 print $i->indent(['text', 'text', 'text'])."\n";

 # Output:
 # text
 # text
 # text

DEPENDENCIES

Class::Utils, Indent::Utils, Readonly.

SEE ALSO

Indent, Indent::Comment, Indent::Data, Indent::Utils, Indent::Word.

REPOSITORY

https://github.com/tupinek/Indent

AUTHOR

Michal Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

BSD License.

VERSION

0.02