From 5c4833d72ee69bdbbc4aefe469caf2913801c96a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 30 May 2013 12:23:16 +0200 Subject: [PATCH] =?utf8?q?Kompatibilit=C3=A4t=20mit=20Text::CSV=5FXS=20>?= =?utf8?q?=3D=200.89?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Helper/Csv.pm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) 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; } -- 2.20.1