Revision 7d9888e3
Von Sven Schöling vor mehr als 13 Jahren hinzugefügt
SL/Helper/Csv.pm | ||
---|---|---|
99 | 99 |
|
100 | 100 |
sub _check_header { |
101 | 101 |
my ($self, %params) = @_; |
102 |
return $self->header if $self->header;
|
|
102 |
my $header = $self->header;
|
|
103 | 103 |
|
104 |
my $header = $self->_csv->getline($self->_io); |
|
104 |
if (! $header) { |
|
105 |
$header = $self->_csv->getline($self->_io); |
|
105 | 106 |
|
106 |
$self->_push_error([ |
|
107 |
$self->_csv->error_input, |
|
108 |
$self->_csv->error_diag, |
|
109 |
0, |
|
110 |
]) unless $header; |
|
107 |
$self->_push_error([ |
|
108 |
$self->_csv->error_input, |
|
109 |
$self->_csv->error_diag, |
|
110 |
0, |
|
111 |
]) unless $header; |
|
112 |
} |
|
111 | 113 |
|
112 |
$self->header([ map { lc } @{ $header } ]); |
|
114 |
return unless $header; |
|
115 |
return $self->header([ map { lc } @$header ]); |
|
113 | 116 |
} |
114 | 117 |
|
115 | 118 |
sub _parse_data { |
Auch abrufbar als: Unified diff
Case insensitive header waren nicht voll abgedeckt, und haben Fehler bei kaputten Headern unterdrückt.