mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-19 10:29:30 +01:00
Added qalc calculator module
This commit is contained in:
parent
7139490067
commit
3baa1cf809
2031
data/factoids
2031
data/factoids
File diff suppressed because it is too large
Load Diff
16
modules/qalc.pl
Executable file
16
modules/qalc.pl
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
|
use warnings;
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
my $args = join ' ', @ARGV;
|
||||||
|
|
||||||
|
my $qargs = quotemeta $args;
|
||||||
|
|
||||||
|
my $result = `qalc $qargs`;
|
||||||
|
|
||||||
|
$result =~ s/^.*approx.\s+//;
|
||||||
|
$result =~ s/^.*=\s+//;
|
||||||
|
|
||||||
|
print "$args = $result\n";
|
||||||
|
# print "$result\n";
|
Loading…
Reference in New Issue
Block a user