Handle undef values in reports, and eval all reports.

This commit is contained in:
Daniel Nichter
2012-08-21 09:24:19 -06:00
parent ca9bee7ae5
commit 6397b3d897
3 changed files with 57 additions and 42 deletions

View File

@@ -256,7 +256,7 @@ sub get_report {
if ( $self->{underline_header} ) {
my @underlines = map { '=' x $_->{print_width} } @{$self->{cols}};
push @lines, $self->_truncate_line(
sprintf($fmt, @underlines),
sprintf($fmt, map { $_ || '' } @underlines),
mark => '',
);
}
@@ -267,7 +267,7 @@ sub get_report {
my @vals = map {
defined $_ ? $_ : $self->{cols}->[$i++]->{undef_value}
} @$vals;
my $line = sprintf($fmt, @vals);
my $line = sprintf($fmt, map { defined $_ ? $_ : '' } @vals);
if ( $self->{extend_right} ) {
$line;
}