Revision 6e00b261
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
SL/LXDebug.pm | ||
---|---|---|
151 | 151 |
return; |
152 | 152 |
} |
153 | 153 |
|
154 |
my %column_lengths; |
|
155 |
my $first_row = 1; |
|
154 |
my %column_lengths = map { $_, length $_ } keys %{ $results->[0] }; |
|
156 | 155 |
|
157 | 156 |
foreach my $row (@{ $results }) { |
158 |
if ($first_row) { |
|
159 |
map { $column_lengths{$_} = length $_ } keys %{ $row }; |
|
160 |
$first_row = 0; |
|
161 |
} |
|
162 |
|
|
163 | 157 |
map { $column_lengths{$_} = length $row->{$_} if (length $row->{$_} > $column_lengths{$_}) } keys %{ $row }; |
164 | 158 |
} |
165 | 159 |
|
Auch abrufbar als: Unified diff
Codevereinfachung