X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2FFactoids%2FQuestion.pl;h=62feedfa7f67a4eb8e790ae4f5fc8d437969ed63;hb=baf19a959699167aa64e4733c9e5cd16d590e600;hp=bd1d47af26a98e50f37a7f9e721ab957c5daf7a4;hpb=0ef144e783640f511679d091e5371567bea14d8f;p=infobot.git diff --git a/src/Factoids/Question.pl b/src/Factoids/Question.pl index bd1d47a..62feedf 100644 --- a/src/Factoids/Question.pl +++ b/src/Factoids/Question.pl @@ -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 :(