The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

 Indent::Utils - Utilities for Indent classes.

SYNOPSIS

 use Indent::Utils qw(line_size_check reduce_duplicit_ws remove_first_ws 
         remove_last_ws remove_ws string_len);
 line_size_check($object_with_line_size_parameter);
 reduce_duplicit_ws(\$string);
 remove_first_ws(\$string);
 remove_last_ws(\$string);
 remove_ws(\$string);
 my $length_of_string = string_len($string);

GLOBAL VARIABLES

TAB_LENGTH
 Default length of tabelator is 8 chars.

SUBROUTINES

line_size_check($object_with_line_size_parameter)
 Line size 'line_size' parameter check. 
reduce_duplicit_ws($string_sr)
 Reduce duplicit blank space in string to one space.
remove_first_ws($string_sr)
 Remove blank characters in begin of string.
remove_last_ws($string_sr)
 Remove blank characters in end of string.
remove_ws($string_sr)
 Remove white characters in begin and end of string.
string_len($string)
 Gets length of string.

ERRORS

 line_size_check():
         'line_size' parameter must be a positive number.
                 'line_size', %s

EXAMPLE1

 # Pragmas.
 use strict;
 use warnings;

 # Modules.
 use Indent::Utils qw(reduce_duplicit_ws);

 my $input = 'a  b';
 reduce_duplicit_ws(\$input);
 print "$input|\n";

 # Output:
 # a b|

EXAMPLE2

 # Pragmas.
 use strict;
 use warnings;

 # Modules.
 use Indent::Utils qw(remove_first_ws);

 my $input = '  a';
 remove_first_ws(\$input);
 print "$input|\n";

 # Output:
 # a|

EXAMPLE3

 # Pragmas.
 use strict;
 use warnings;

 # Modules.
 use Indent::Utils qw(remove_last_ws);

 my $input = 'a   ';
 remove_last_ws(\$input);
 print "$input|\n";

 # Output:
 # a|

EXAMPLE4

 # Pragmas.
 use strict;
 use warnings;

 # Modules.
 use Indent::Utils qw(remove_ws);

 my $input = '   a   ';
 remove_ws(\$input);
 print "$input|\n";

 # Output:
 # a|

EXAMPLE5

 # Pragmas.
 use strict;
 use warnings;

 # Modules.
 use Indent::Utils qw(string_len);

 # Print string length.
 print string_len("\tab\t")."\n";

 # Output:
 # 18

DEPENDENCIES

Error::Pure, Exporter, Readonly.

SEE ALSO

Indent, Indent::Block, Indent::Data, 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.03