… | |
… | |
51 | It supports a number of command constructs. They have to follow the |
51 | It supports a number of command constructs. They have to follow the |
52 | C<@match> directive, and there can be multiple commands that will be |
52 | C<@match> directive, and there can be multiple commands that will be |
53 | executed in order. |
53 | executed in order. |
54 | |
54 | |
55 | =over 4 |
55 | =over 4 |
|
|
56 | |
|
|
57 | =item @comment text... |
|
|
58 | |
|
|
59 | A single-line comment. It will be completely ignored. |
56 | |
60 | |
57 | =item @parse regex |
61 | =item @parse regex |
58 | |
62 | |
59 | Parses the message using a perl regular expression (by default |
63 | Parses the message using a perl regular expression (by default |
60 | case-insensitive). Any matches will be available as C<< $match->[$index] |
64 | case-insensitive). Any matches will be available as C<< $match->[$index] |
… | |
… | |
211 | |
215 | |
212 | if ($cmd eq "parse" || $cmd eq "match") { # match is future rename |
216 | if ($cmd eq "parse" || $cmd eq "match") { # match is future rename |
213 | no re 'eval'; # default, but make sure |
217 | no re 'eval'; # default, but make sure |
214 | @match = $msg =~ /$args/i |
218 | @match = $msg =~ /$args/i |
215 | or next topic; |
219 | or next topic; |
|
|
220 | |
|
|
221 | } elsif ($cmd eq "comment") { |
|
|
222 | # nop |
216 | |
223 | |
217 | } elsif ($cmd eq "cond") { |
224 | } elsif ($cmd eq "cond") { |
218 | cf::safe_eval $args, %vars |
225 | cf::safe_eval $args, %vars |
219 | or next topic; |
226 | or next topic; |
220 | |
227 | |