Indent::Data - Class for data indenting.
use Indent::Data; my $indent_data = Indent::Data->new(%parameters); my @data = $indent_data->indent($data, [$indent, $non_indent]);
new(%parameters)
Constructor.
line_size
Sets indent line size value. Default value is 79.
next_indent
Sets next indent string. Default value is tabelator (\t).
output_separator
Sets output separator between indented datas for string context. Default value is newline (\n).
indent($data, [$act_indent, $non_indent])
Indent text data to line_size block size. $act_indent - Actual indent string. Will be in each output string. Length of $act_indent variable must be less then ('line_size' - length of 'next_indent' - 1). $non_indent - Is flag for non indenting. Default is 0.
new(): Bad 'line_size' = '%s' or length of string '%s'. Bad actual indent value. Length is greater then ('line_size' - 'size of next_indent' - 1). From Class::Utils::set_params(): Unknown parameter '%s'. indent(): From Indent::Utils::line_size_check(): 'line_size' parameter must be a positive number. line_size => %s
use strict; use warnings; use Indent::Data; # Indent::Data object. my $i = Indent::Data->new( 'line_size' => '10', 'next_indent' => ' ', 'output_separator' => "|\n", ); # Print indented text. print $i->indent('text text text text text text')."|\n"; # Output: # text text | # text tex| # t text t| # ext|
use strict; use warnings; use Indent::Data; # Indent::Data object. my $i = Indent::Data->new( 'line_size' => '10', 'next_indent' => ' ', 'output_separator' => "|\n", ); # Print indented text. print $i->indent('text text text text text text', '<->')."|\n"; # Output: # <->text te| # <-> xt te| # <-> xt te| # <-> xt te| # <-> xt te| # <-> xt|
use strict; use warnings; use Indent::Data; # Indent::Data object. my $i = Indent::Data->new( 'line_size' => '10', 'next_indent' => ' ', 'output_separator' => "|\n", ); # Print indented text. print $i->indent('text text text text text text', '<->', 1)."|\n"; # Output: # <->text text text text text text|
Class::Utils, Error::Pure, Indent::Utils, Readonly.
Class for indent handling.
Class for block indenting.
Class for text indenting.
Utilities for Indent classes.
Class for word indenting.
https://github.com/tupinek/Indent
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© 2005-2018 Michal Josef Špaček BSD 2-Clause License
0.04
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.