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

 use strict;
 use warnings;

 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

Class for indent handling.

Indent::Data

Class for data indenting.

Indent::String

Class for text indenting.

Indent::Utils

Utilities for Indent classes.

Indent::Word

Class for word indenting.

REPOSITORY

https://github.com/tupinek/Indent

AUTHOR

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

http://skim.cz

LICENSE AND COPYRIGHT

 © 2005-2018 Michal Josef Špaček
 BSD 2-Clause License

VERSION

0.05