From f6665969ac86e5e32fa120cbe17a18f16cd2b11c Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Mon, 2 Aug 2021 17:52:38 -0700 Subject: [PATCH] modules/qalc.pl: refactor and clean-up ugly code --- modules/qalc.pl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/qalc.pl b/modules/qalc.pl index a4fb9f32..f0350e8f 100755 --- a/modules/qalc.pl +++ b/modules/qalc.pl @@ -6,18 +6,14 @@ use warnings; use strict; -my $args = join ' ', @ARGV; - -if (not length $args) { +if (not @ARGV) { print "Usage: qalc \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";