X-Git-Url: http://git.vpit.fr/?p=perl%2Fscripts%2Fxchat.git;a=blobdiff_plain;f=hl.pl;h=ce53996a0d76f09eee1ff40c8d6b0221dbd2a501;hp=1af2f58d2e683d7363cb4a18a443903c5da4233d;hb=ffe36ae4fd26ac981a28f5e776d8424f1d56da2a;hpb=c121cd3291c152431e30f27a7fcd754ec07aaceb diff --git a/hl.pl b/hl.pl index 1af2f58..ce53996 100755 --- a/hl.pl +++ b/hl.pl @@ -20,7 +20,7 @@ sub guihl { hook_print 'Private Message to Dialog', sub { guihl; return EAT_NONE }; -my %words = ( +my %hl = ( '#cpantesters' => [ qw/ Acme-CPANAuthors-You-re_using B-RecDeparse @@ -44,14 +44,14 @@ my %words = ( / ], ); -for (keys %words) { - my $rx = '(?:' . (join '|', @{$words{$_}}) . ')'; - $words{$_} = qr/$rx/; +for (keys %hl) { + my $rx = '(?:' . join('|', @{$hl{$_}}) . ')'; + $hl{$_} = qr/$rx/; } filter 'Channel Action' => sub { my $chan = lc get_info 'channel'; - if ($words{$chan} and $_[1] =~ /$words{$chan}/) { + if ($hl{$chan} and $_[1] =~ /$hl{$chan}/) { guihl; 1; } else {