Subject: | incorrect / unneeded spaces in humanize output |
Time::Human's humanize routine returns strings with too many spaces,
sometimes. Here are some examples:
DB<1> use Time::Human
DB<2> x humanize localtime
0 'just after five past midday '
DB<3> x humanize localtime(0)
0 'exactly seven o\'clock in the evening '
The attached patch fixes this.
--
rjbs
Subject: | spaces.patch |
--- /usr/local/lib/perl5/site_perl/5.8.8/Time/Human.pm 2002-05-30 07:01:27.000000000 -0400
+++ Human.pm 2006-06-03 12:16:02.000000000 -0400
@@ -80,6 +80,7 @@
$rv =~ s/%m/$say_min/g;
$rv =~ s/%h/$say_hour/g;
$rv =~ s/%d/$daytime/g;
+ $rv =~ s/^\s+|(?<=\s)\s|\s+$//g
return $rv;
}