Indent::Block - Class for block indenting.
use Indent::Block; my $obj = Indent::Block->new(%parameters); my $string = $obj->indent($data, [$act_indent, $non_indent]); my @data = $obj->indent($data, [$act_indent, $non_indent]);
new
my $obj = Indent::Block->new(%parameters);
Constructor.
Returns instance of object.
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
my $string = $obj->indent($data, [$act_indent, $non_indent]);
or
my @data = $obj->indent($data, [$act_indent, $non_indent]);
Indent method.
- C<$data_ar> - Reference to array with strings to indent. - C<$act_indent> - String to actual indent. - C<$non_indent> - Flag, that says 'no-indent' for current time.
Returns string to print or array of data to print.
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
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
Class::Utils, Indent::Utils, Readonly.
Class for indent handling.
Class for data indenting.
Class for text indenting.
Utilities for Indent classes.
Class for word indenting.
https://github.com/michal-josef-spacek/Indent
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© 2005-2021 Michal Josef Špaček
BSD 2-Clause License
0.08
To install Indent, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Indent
CPAN shell
perl -MCPAN -e shell install Indent
For more information on module installation, please visit the detailed CPAN module installation guide.