• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

lib/String/H03-May-2022-18555

t/H21-Apr-2011-301250

xt/H03-May-2022-16095

ChangesH A D21-Apr-2011370 1812

LICENSEH A D21-Apr-201117.8 KiB378292

MANIFESTH A D21-Apr-2011586 3433

META.jsonH A D21-Apr-20111.6 KiB5553

META.ymlH A D21-Apr-2011822 3029

Makefile.PLH A D21-Apr-20111.3 KiB5844

READMEH A D21-Apr-20112.9 KiB9369

README

1NAME
2    String::Trim - trim whitespace from your strings
3
4VERSION
5    version 0.005
6
7SYNOPSIS
8        use String::Trim;
9
10        print "Do it? ";
11        trim(my $response = <>);
12        print "'$response'\n";
13
14DESCRIPTION
15    "String::Trim" trims whitespace off your strings. chomp trims only $/
16    (typically, that's newline), but "trim" will trim all leading and
17    trailing whitespace.
18
19FUNCTIONS
20  trim
21    Returns the string with all leading and trailing whitespace removed.
22    Trimming undef gives you undef. Alternatively, you can trim in-place.
23
24        my $var     = ' my string  ';
25        my $trimmed = trim($var);
26        # OR
27        trim($var);
28
29    "trim" also knows how to trim an array or arrayref:
30
31        my @to_trim = (' one ', ' two ', ' three ');
32        my @trimmed = trim(@to_trim);
33        # OR
34        trim(@to_trim);
35        # OR
36        my $trimmed = trim(\@to_trim);
37        # OR
38        trim(\@to_trim);
39
40RATIONALE
41    "trim" is often used by beginners, who may not understand how to spin
42    their own. While String::Util does have a "trim" function, it depends on
43    Debug::ShowStuff, which depends on Taint, which fails the test suite,
44    and doesn't appear to be maintained. This module installs, is actively
45    maintained, and has no non-core dependencies.
46
47    Other options include Text::Trim and String::Strip (which is implemented
48    in XS, and is therefore likely to be very fast, but requires a C
49    compiler).
50
51AVAILABILITY
52    The latest version of this module is available from the Comprehensive
53    Perl Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find a
54    CPAN site near you, or see <http://search.cpan.org/dist/String-Trim/>.
55
56    The development version lives at <http://github.com/doherty/String-Trim>
57    and may be cloned from <git://github.com/doherty/String-Trim.git>.
58    Instead of sending patches, please fork this project using the standard
59    git and github infrastructure.
60
61SOURCE
62    The development version is on github at
63    <http://github.com/doherty/String-Trim> and may be cloned from
64    <git://github.com/doherty/String-Trim.git>
65
66BUGS AND LIMITATIONS
67    No bugs have been reported.
68
69    Please report any bugs or feature requests through the web interface at
70    <https://github.com/doherty/String-Trim/issues>.
71
72CREDITS
73    This module was inspired by code at
74    <http://www.perlmonks.org/?node_id=36684> written by japhy (Jeff
75    Pinyan), dragonchild, and Aristotle. This Perl module was written by
76    Mike Doherty.
77
78AUTHORS
79    *   Mike Doherty <doherty@cpan.org>
80
81    *   Jeff Pinyan <pinyan@cpan.org>
82
83    *   Rob Kinyon <rkinyon@cpan.org>
84
85    *   Αριστοτέλης Παγκαλτζής (Aristotle Pagaltzis) <aristotle@cpan.org>
86
87COPYRIGHT AND LICENSE
88    This software is copyright (c) 2010 by Mike Doherty.
89
90    This is free software; you can redistribute it and/or modify it under
91    the same terms as the Perl 5 programming language system itself.
92
93