diff options
| author | Teddy Wing | 2015-06-14 02:18:56 -0400 |
|---|---|---|
| committer | Teddy Wing | 2015-06-14 02:18:56 -0400 |
| commit | d6f76b336715ca0fc9a11b2d2bd26500918a0e9f (patch) | |
| tree | 9855e1243218fab112bb72ff2fbcf975a74d6297 | |
| parent | a6fdd1f6f7a23d03796a04d51220478a50194146 (diff) | |
| download | irssi-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.pl | 4 |
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 { |
