X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2FModules%2FMath.pl;h=bf1b41a3c53a52dddf19525e1cb4515b36217a26;hb=f31097ab45dca4b19e255801c966e9cd552eece4;hp=d8d4898377c6abe26d1daa0e9af9b70189c0ce8b;hpb=58e31f834c5a287e71520afacde35a83e1e049d2;p=infobot.git diff --git a/src/Modules/Math.pl b/src/Modules/Math.pl index d8d4898..bf1b41a 100644 --- a/src/Modules/Math.pl +++ b/src/Modules/Math.pl @@ -110,21 +110,22 @@ sub perlMath { $locMsg = sprintf("%1.12f", $locMsg); $locMsg =~ s/\.?0+$//; - if (length($locMsg) > 30) { + if (length $locMsg > 30) { $locMsg = "a number with quite a few digits..."; } } else { if (defined $locMsg) { &DEBUG("math: locMsg => '$locMsg'... FIXME"); } else { - $locMsg = "undefined"; + &status("math: could not really compute."); + $locMsg = ""; } } } else { $locMsg = ""; } - if ($locMsg ne $message) { + if (defined $logMsg and $locMsg ne $message) { return $locMsg; } else { return '';