]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Factoids/Question.pl
- I broke maths when I tried to fix "999!" - fixed :-)
[infobot.git] / src / Factoids / Question.pl
index bd1d47af26a98e50f37a7f9e721ab957c5daf7a4..62feedfa7f67a4eb8e790ae4f5fc8d437969ed63 100644 (file)
@@ -95,8 +95,14 @@ sub doQuestion {
            my @vals;
            my $arg = $_;
 
-           eval {
-               next unless ($query[0] =~ /^$arg$/i);
+           # todo: make eval work with $$i's :(
+#          next unless (eval { $query[0] =~ /^$arg$/i });
+           next unless ($query[0] =~ /^$arg$/i);
+
+           if ($@) {   # it failed!!!
+               &WARN("factargs: regex failed! '$query[0]' =~ /^$_\$/");
+               next;
+           }
 
                for ($i=1; $i<=5; $i++) {
                    $val = $$i;
@@ -104,12 +110,8 @@ sub doQuestion {
 
                    push(@vals, $val);
                }
-           };
+#          };
 
-           if ($@) {   # it failed!!!
-               &WARN("factargs: regex failed! '$query[0]' =~ /^$_\$/");
-               next;
-           }
 
            &status("Question: factoid Arguments for '$query[0]'");
            # todo: use getReply() - need to modify it :(