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
1 changed files with 3 additions and 7 deletions

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";