--- trunk/lib/WebPAC/Validate.pm 2007/05/23 20:03:12 830 +++ trunk/lib/WebPAC/Validate.pm 2007/05/24 10:53:48 834 @@ -405,6 +405,56 @@ } +=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->error("called without delimiters"); + return; + } + + my $out; + + foreach my $f (sort { $a <=> $b } keys %$t) { + $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"; + } + } + + return $out; +} + =head1 AUTHOR Dobrica Pavlinusic, C<< >>