Browse Source

Optimisation regex

Julien Vaubourg 13 years ago
parent
commit
645c03f8bb
1 changed files with 3 additions and 3 deletions
  1. 3 3
      fdnTopicAddBot/fdn-accbot.pl

+ 3 - 3
fdnTopicAddBot/fdn-accbot.pl

@@ -19,11 +19,11 @@ if(@ARGV && ! -w "$ARGV[0]" || !@ARGV) {
 my $nick = "accbot";
 my $chan = "#fdnbotteste";
 my $url = "http://fdn.ldn-fai.net";
-my $file = $ARGV[0];
 my $flag = "[ACC]";
 
-my $isacc = 0;
 my $bot;
+my $file = $ARGV[0];
+my $isacc = 0;
 
 sub said {
 	my $self = shift;
@@ -41,7 +41,7 @@ sub topic {
 	my $args = shift;
 
 	if($args->{"topic"}) {
-		if($args->{"topic"} =~ /^.*\Q$flag\E\s*(.+)$/i) {
+		if($args->{"topic"} =~ /\Q$flag\E\s*(.+)$/i) {
 			$isacc = 1;
 
 			open(OUT, ">$file");