use strict;
use warnings;
+use re 'eval';
+
use constant DIR_AD => "/usr/local/squid/etc/ad";
chomp;
next if !$_;
$patt.="|" if $patt;
- $patt.=$_;
+ $patt.=$_."(?{ '";
+ s/'/'."'".'/g;
+ $patt.="$_'; })";
}
close M4;
$|=1;
while (<>) {
- s@^http://($patt).*\n$@http://localhost/cgi-bin/redirector-ad.cgi?$1\n@os;
+ s@^http://($patt).*\n$@http://localhost/cgi-bin/redirector-ad.cgi?$^R\n@os;
print;
}