aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2015-06-14 02:18:56 -0400
committerTeddy Wing2015-06-14 02:18:56 -0400
commitd6f76b336715ca0fc9a11b2d2bd26500918a0e9f (patch)
tree9855e1243218fab112bb72ff2fbcf975a74d6297
parenta6fdd1f6f7a23d03796a04d51220478a50194146 (diff)
downloadirssi-hipchat-stfu-d6f76b336715ca0fc9a11b2d2bd26500918a0e9f.tar.bz2
prettify_hipchat: Trim whitespace
Trim whitespace around the beginning and end of the text. Based on http://perlmaven.com/trim. There's some problem where some ending whitespace isn't getting trimmed from some of the strings. Still not sure what's going on here.
-rw-r--r--hipchat-stfu.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/hipchat-stfu.pl b/hipchat-stfu.pl
index 6975216..2e06d69 100644
--- a/hipchat-stfu.pl
+++ b/hipchat-stfu.pl
@@ -13,6 +13,10 @@ $VERSION = '1.00';
);
sub prettify_hipchat {
+ my ($input) = @_;
+
+ $input =~ s/^\s+|\s+$//g;
+ return $input;
};
sub hipchat_stfu {