File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,9 @@ PROCESS_LINE: while ( <<>> ) {
173173
174174$unique_domains {$domain }++;
175175} 
176- return \% unique_domains; 
176+ wantarray 
177+ ? return %unique_domains  
178+ : return \% unique_domains; 
177179} 
178180
179181our $opt_h ; 
@@ -185,23 +187,23 @@ usage if defined($opt_h);
185187my @formats  = qw(plain unbound rpz); 
186188first { $opt_t  eq $_  } @formats  or die "$opt_t  is not a valid type.\n "; 
187189
188- my $domain_appearances_hashref  = &unique_domains 
190+ my %domain_appearances  = &unique_domains 
189191or die "Unable to extract any domains from input.\n "; 
190192
191193if ( $opt_t  eq 'plain' ) { 
192- print map { "$_ \n " } sort keys %$domain_appearances_hashref  ; 
194+ print map { "$_ \n " } sort keys %domain_appearances  ; 
193195} 
194196elsif ( $opt_t  eq 'unbound' ) { 
195197print map { "local-zone: \" $_ \"  always_refuse\n " } 
196- sort keys %$domain_appearances_hashref  ; 
198+ sort keys %domain_appearances  ; 
197199} 
198200elsif ( $opt_t  eq 'rpz' ) { 
199- &reduce_domains( $domain_appearances_hashref  ); 
201+ &reduce_domains( \% domain_appearances  ); 
200202
201203#<<< 
202204print map { 
203205"$_  CNAME .\n " 
204206. "*.$_  CNAME .\n " 
205- } sort keys %$domain_appearances_hashref  ; 
207+ } sort keys %domain_appearances  ; 
206208#>>> 
207209} 
                                 You can’t perform that action at this time. 
               
                  
0 commit comments