--- trunk/lib/WebPAC/Validate.pm 2007/05/23 20:03:16 832 +++ trunk/lib/WebPAC/Validate.pm 2007/05/24 10:53:48 834 @@ -407,27 +407,48 @@ =head2 delimiters_templates +Generate report of delimiter tamplates + + my $report = $validate->delimiter_teplates( + report => 1, + ); + +Options: + +=over 4 + +=item report + +Generate humanly readable report with single fields + +=back =cut sub delimiters_templates { my $self = shift; + my $args = {@_}; + my $t = $self->{_delimiters_templates}; my $log = $self->_get_logger; unless ($t) { - $log->warn("called without delimiters"); + $log->error("called without delimiters"); return; } my $out; foreach my $f (sort { $a <=> $b } keys %$t) { - $out .= "$f\n"; - foreach my $sft (sort { $a cmp $b } keys %{ $t->{$f} }) { - $out .= "\t" . $t->{$f}->{$sft} . "\t$sft\n"; + $out .= "$f\n" if ( $args->{report} ); + foreach my $template (sort { $a cmp $b } keys %{ $t->{$f} }) { + my $count = $t->{$f}->{$template}; + $out .= + ( $count ? "" : "# " ) . + ( $args->{report} ? "" : "$f\t" ) . + "\t$count\t$template\n"; } }