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