Linux Audio

Check our new training course

Loading...
v4.10.11
 1#!/usr/bin/perl
 2
 3open (IN,"ktest.pl");
 4while (<IN>) {
 5    # hashes are now used
 6    if (/\$opt\{"?([A-Z].*?)(\[.*\])?"?\}/ ||
 7	/^\s*"?([A-Z].*?)"?\s*=>\s*/ ||
 8	/set_test_option\("(.*?)"/) {
 9	$opt{$1} = 1;
10    }
11}
12close IN;
13
14open (IN, "sample.conf");
15while (<IN>) {
16    if (/^\s*#?\s*([A-Z]\S*)\s*=/) {
17	$samp{$1} = 1;
18    }
19}
20close IN;
21
22foreach $opt (keys %opt) {
23    if (!defined($samp{$opt})) {
24	print "opt = $opt\n";
25    }
26}
27
28foreach $samp (keys %samp) {
29    if (!defined($opt{$samp})) {
30	print "samp = $samp\n";
31    }
32}
v3.1
 1#!/usr/bin/perl
 2
 3open (IN,"ktest.pl");
 4while (<IN>) {
 
 5    if (/\$opt\{"?([A-Z].*?)(\[.*\])?"?\}/ ||
 
 6	/set_test_option\("(.*?)"/) {
 7	$opt{$1} = 1;
 8    }
 9}
10close IN;
11
12open (IN, "sample.conf");
13while (<IN>) {
14    if (/^\s*#?\s*(\S+)\s*=/) {
15	$samp{$1} = 1;
16    }
17}
18close IN;
19
20foreach $opt (keys %opt) {
21    if (!defined($samp{$opt})) {
22	print "opt = $opt\n";
23    }
24}
25
26foreach $samp (keys %samp) {
27    if (!defined($opt{$samp})) {
28	print "samp = $samp\n";
29    }
30}