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:
parent
a0e2ba3610
commit
f6665969ac
10
modules/qalc.pl
vendored
10
modules/qalc.pl
vendored
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user