Indent::Block - Class for block indenting.
use Indent::Block; my $i = Indent::Block->new(%parameters); print $i->indent($data, [$act_indent, $non_indent]);
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.
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
# 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
Class::Utils, Indent::Utils, Readonly.
Indent, Indent::Comment, Indent::Data, Indent::Utils, Indent::Word.
https://github.com/tupinek/Indent
Michal Špaček mailto:skim@cpan.org
http://skim.cz
BSD License.
0.01
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.