3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 11:12:42 +01:00

modules/qalc.pl: refactor and clean-up ugly code

This commit is contained in:
Pragmatic Software 2021-08-02 17:52:38 -07:00
parent a0e2ba3610
commit f6665969ac

10
modules/qalc.pl vendored
View File

@ -6,18 +6,14 @@
use warnings;
use strict;
my $args = join ' ', @ARGV;
if (not length $args) {
if (not @ARGV) {
print "Usage: qalc <expression>\n";
exit;
}
my $result = `ulimit -t 2; qalc '$args'`;
my $result = `ulimit -t 2; qalc \Q@ARGV\E`;
$result =~ s/^.*approx.\s+//;
$result =~ s/^.*=\s+//;
print "$args = $result\n";
# print "$result\n";
print "@ARGV = $result\n";