3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-06 11:28:43 +02:00
pbot/modules/math.pl
Pragmatic Software 2c44e648fb Initial import
2007-05-20 20:44:44 +00:00

25 lines
375 B
Perl
Executable File

#!/usr/bin/perl -w
# Quick and dirty by :pragma
use strict;
my ($arguments, $response);
if ($#ARGV < 0)
{
print "Dumbass.\n";
die;
}
$arguments = join(" ", @ARGV);
if($arguments =~ m/[\$a-z]/i)
{
print("Illegal characters, please only use numbers and valid operators (+, -, /, *, etc).");
die();
}
$response = eval($arguments);
print "$arguments = $response";