[libcode-tidyall-perl] 197/374: add trim

Jonas Smedegaard js at alioth.debian.org
Sun Sep 29 22:26:18 UTC 2013


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libcode-tidyall-perl.

commit cc6ceac3bbd31cf97b1ef28b5bcd9561641c4102
Author: Jonathan Swartz <swartz at pobox.com>
Date:   Thu Sep 6 15:36:32 2012 -0700

    add trim
---
 lib/Code/TidyAll/Util.pm |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/Code/TidyAll/Util.pm b/lib/Code/TidyAll/Util.pm
index 0a0c351..85477c4 100644
--- a/lib/Code/TidyAll/Util.pm
+++ b/lib/Code/TidyAll/Util.pm
@@ -14,7 +14,7 @@ use warnings;
 use base qw(Exporter);
 
 our @EXPORT_OK =
-  qw(abs2rel basename can_load dirname dump_one_line mkpath pushd read_dir read_file realpath rel2abs tempdir_simple uniq write_file );
+  qw(abs2rel basename can_load dirname dump_one_line mkpath pushd read_dir read_file realpath rel2abs tempdir_simple trim uniq write_file );
 
 sub can_load {
 
@@ -59,4 +59,10 @@ sub pushd {
     return guard { chdir($cwd) };
 }
 
+sub trim {
+    my ($str) = @_;
+    for ($str) { s/^\s+//; s/\s+$// }
+    return $str;
+}
+
 1;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcode-tidyall-perl.git



More information about the Pkg-perl-cvs-commits mailing list