From b3ca5e69cd8ef7289e3ff33792664275562aea36 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 12 Jun 2020 18:57:01 -0700 Subject: [PATCH] Factoids: expand_factoid_vars(): special-case Perl's $a and $b, etc --- PBot/Factoids.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index e3b37883..9809fdba 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -765,8 +765,8 @@ sub expand_factoid_vars { $extract_method = 'regex'; } - if ($var =~ /^(?:_.*|nick|channel|randomnick|arglen|args|arg\[.+\])$/i) { - # skip identifiers with leading underscore and special variables + if ($var =~ /^(?:_.*|\d+|a|b|nick|channel|randomnick|arglen|args|arg\[.+\])$/i) { + # skip identifiers with leading underscores, etc $result .= $extract_method eq 'bracket' ? '${' . $var . '}' : '$' . $var; next; }