407 |
|
|
408 |
=head2 delimiters_templates |
=head2 delimiters_templates |
409 |
|
|
410 |
|
Generate report of delimiter tamplates |
411 |
|
|
412 |
|
my $report = $validate->delimiter_teplates( |
413 |
|
report => 1, |
414 |
|
); |
415 |
|
|
416 |
|
Options: |
417 |
|
|
418 |
|
=over 4 |
419 |
|
|
420 |
|
=item report |
421 |
|
|
422 |
|
Generate humanly readable report with single fields |
423 |
|
|
424 |
|
=back |
425 |
|
|
426 |
=cut |
=cut |
427 |
|
|
428 |
sub delimiters_templates { |
sub delimiters_templates { |
429 |
my $self = shift; |
my $self = shift; |
430 |
|
|
431 |
|
my $args = {@_}; |
432 |
|
|
433 |
my $t = $self->{_delimiters_templates}; |
my $t = $self->{_delimiters_templates}; |
434 |
|
|
435 |
my $log = $self->_get_logger; |
my $log = $self->_get_logger; |
436 |
|
|
437 |
unless ($t) { |
unless ($t) { |
438 |
$log->warn("called without delimiters"); |
$log->error("called without delimiters"); |
439 |
return; |
return; |
440 |
} |
} |
441 |
|
|
442 |
my $out; |
my $out; |
443 |
|
|
444 |
foreach my $f (sort { $a <=> $b } keys %$t) { |
foreach my $f (sort { $a <=> $b } keys %$t) { |
445 |
$out .= "$f\n"; |
$out .= "$f\n" if ( $args->{report} ); |
446 |
foreach my $sft (sort { $a cmp $b } keys %{ $t->{$f} }) { |
foreach my $template (sort { $a cmp $b } keys %{ $t->{$f} }) { |
447 |
$out .= "\t" . $t->{$f}->{$sft} . "\t$sft\n"; |
my $count = $t->{$f}->{$template}; |
448 |
|
$out .= |
449 |
|
( $count ? "" : "# " ) . |
450 |
|
( $args->{report} ? "" : "$f\t" ) . |
451 |
|
"\t$count\t$template\n"; |
452 |
} |
} |
453 |
} |
} |
454 |
|
|