Hello Folks,
I must be blind that I cant figure out this perl script why I end up with ;; at the end of the line.
I am not an expert by any means
HTML Code:
#!/usr/bin/perl
use File::Find;
open F,shift or die $!;
my %ip=map/(\S+)\s+(\S+)/,<F>;
close F;
find sub{
if( -f ){
local @ARGV=($_);
local $^I="";
while( <> ){
s/^(option\s+domain-name-servers\s.*)/$1;/ && s/([\w.]*\w)\.?/$ip{$1}||$1/eg;
print;
}
}
},@ARGV
I am doing a search and replace, but after it runs, I get
;;
option domain-name-servers 126.7.3.101, 166.2.100.78
;;
I only need it to look like this
option domain-name-servers 126.7.3.101, 166.2.100.78
;