From: Sven Schöling Date: Thu, 30 May 2013 10:23:16 +0000 (+0200) Subject: Kompatibilität mit Text::CSV_XS >= 0.89 X-Git-Tag: release-3.1.0beta1~401^2 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=5c4833d72ee69bdbbc4aefe469caf2913801c96a;p=kivitendo-erp.git Kompatibilität mit Text::CSV_XS >= 0.89 --- diff --git a/SL/Helper/Csv.pm b/SL/Helper/Csv.pm index e48161492..2d454be37 100644 --- a/SL/Helper/Csv.pm +++ b/SL/Helper/Csv.pm @@ -3,6 +3,7 @@ package SL::Helper::Csv; use strict; use warnings; +use version 0.77; use Carp; use IO::File; use Params::Validate qw(:all); @@ -156,11 +157,19 @@ sub _parse_data { push @data, \%hr; } else { last if $self->_csv->eof; - push @errors, [ - $self->_csv->error_input, - $self->_csv->error_diag, - $self->_io->input_line_number, - ]; + # Text::CSV_XS 0.89 added record number to error_diag + if (qv(Text::CSV_XS->VERSION) >= qv('0.89')) { + push @errors, [ + $self->_csv->error_input, + $self->_csv->error_diag, + ]; + } else { + push @errors, [ + $self->_csv->error_input, + $self->_csv->error_diag, + $self->_io->input_line_number, + ]; + } } last if $self->_csv->eof; }