equal
deleted
inserted
replaced
1 #!/usr/bin/perl -w |
1 #!/usr/bin/perl |
2 |
2 |
3 use strict; |
3 use strict; |
|
4 use warnings; |
|
5 |
|
6 my @configs = qw(dnstools.conf /etc/dnstools.conf); |
|
7 |
|
8 foreach (grep {-f} @configs) { |
|
9 open(CONFIG, $_) or die "Can't open $_: $!\n"; |
|
10 } |
|
11 die "Can't open config (searched: @configs)\n" |
|
12 if not seek(CONFIG, 0, 0); |
4 |
13 |
5 my %config; |
14 my %config; |
6 open (CONFIG, "dnstools.conf"); |
|
7 while (<CONFIG>) { |
15 while (<CONFIG>) { |
8 chomp; |
16 chomp; |
9 s/#.*//; |
17 s/#.*//; |
10 s/\t//g; |
18 s/\t//g; |
11 s/\s//g; |
19 s/\s//g; |