$regex = join('|', keys %$track);
warn "# track regex: $regex\n";
} elsif ( $regex && $message =~ m/($regex)/ ) {
- my $found = $1;
- my $body = "TRACK [$found] $channel | $message";
- print "$body\n";
- my $to = $track->{$found} || die "no $1 in ",dump($track);
- $to =~ s/^MSG /SEND /g;
- MQR::Redis->publish( $to, $body );
+ my $m = $message;
+ while ( $m =~ s/($regex)// ) {
+ my $found = $1;
+ my $body = "TRACK [$found] $channel | $message";
+ print "$body\n";
+ my $to = $track->{$found} || die "no $1 in ",dump($track);
+ $to =~ s/^MSG /SEND /g;
+ MQR::Redis->publish( $to, $body );
+ }
}
} else {
warn "$channel | $message\n";