-
-
01 Apr 2021 13:12:59 UTC
- Distribution: Trim
- Module version: 20210401
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues
- Testers (123 / 0 / 46)
- Kwalitee
Bus factor: 1- 86.17% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (4.77KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Carp
- Test2::API
- Test::More
- feature
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
Name
Trim - Trim various things by removing leading and trailing whitespace
Synopsis
Trim nested structures in situ referenced from $_:
{$_ = [" a ", " b ", {" c " => {" d\n ", " e "}}]; trim; is_deeply $_, ["a", "b", { c => { d => "e" } }]; }
Trim nested structures in situ:
{my $a = [" a ", " b ", {" c " => {" d\n ", " e "}}]; trim $a; is_deeply $a, ["a", "b", { c => { d => "e" } }]; }
Trim cloned nested structures:
{my $a = [" a ", " b ", {" c " => {" d\n ", " e "}}]; my $b = trim $a; is_deeply $b, ["a", "b", { c => { d => "e" } }]; }
Description
Trim various things by removing leading and trailing whitespace
Version "20210401".
The following sections describe the methods in each functional area of this module. For an alphabetic listing of all methods by name see Index.
Trim
Trim strings, arrays, hashes in situ and clones thereof.
trim(@things)
Trim somethings.
Parameter Description 1 @things Things to be trimmed
Example:
$_ = [" a ", " b ", {" c " => {" d ", " e "}}]; # Trim nested structures in situ referenced from $_ trim; # 𝗘𝘅𝗮𝗺𝗽𝗹𝗲 is_deeply $_, ["a", "b", { c => { d => "e" } }]; } {my $a = [" a ", " b ", {" c " => {" d ", " e "}}]; # Trim nested structures in situ trim $a; # 𝗘𝘅𝗮𝗺𝗽𝗹𝗲 is_deeply $a, ["a", "b", { c => { d => "e" } }]; } {my $a = [" a ", " b ", {" c " => {" d ", " e "}}]; # Trim cloned nested structures my $b = trim $a; # 𝗘𝘅𝗮𝗺𝗽𝗹𝗲 is_deeply $b, ["a", "b", { c => { d => "e" } }];
Index
1 trim - Trim somethings.
Installation
This module is written in 100% Pure Perl and, thus, it is easy to read, comprehend, use, modify and install via cpan:
sudo cpan install Trim
Author
Copyright
Copyright (c) 2016-2021 Philip R Brenan.
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
Module Install Instructions
To install Trim, copy and paste the appropriate command in to your terminal.
cpanm Trim
perl -MCPAN -e shell install Trim
For more information on module installation, please visit the detailed CPAN module installation guide.