I forgot this one...
Le 11/11/2012 19:13, [email protected] a écrit :
+## Append a custom string to log view adding date
+sub logText {
+ my ($st) = @_;
+ my $string = chomp_(`LC_ALL=C date '+%Y %b %d %T'`) . " " . $st . "\n";
+ # `` return non utf8 and concat of non utf8 & utf8 is non utf8:
+ c::set_tagged_utf8($string);
+
+ # log given text
+ $logView->appendLines($string);
+}
It is especially ugly to call external date binary, whereas perl has
everything needed as builtin functions for this. See "time related
functions" in perlfunc(1), and POSIX::strftime in POSIX(3pm) if you need
a simple formation function.
--
BOFH excuse #66:
bit bucket overflow