From 8269a9775931a4d7f5e7a564fbf0a385bb5420ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 30 Dec 2014 11:25:28 +0100 Subject: [PATCH] Csv: wantarray syntax entfernt. --- SL/Controller/CsvImport/Base.pm | 4 ++-- SL/Controller/CsvImport/BaseMulti.pm | 4 ++-- SL/Helper/Csv.pm | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SL/Controller/CsvImport/Base.pm b/SL/Controller/CsvImport/Base.pm index c94f1bac3..971269790 100644 --- a/SL/Controller/CsvImport/Base.pm +++ b/SL/Controller/CsvImport/Base.pm @@ -59,7 +59,7 @@ sub run { $self->controller->raw_data_headers({ used => { }, headers => [ ] }); $self->controller->info_headers({ used => { }, headers => [ ] }); - my @objects = $self->csv->get_objects; + my $objects = $self->csv->get_objects; $self->controller->track_progress(progress => 70); @@ -67,7 +67,7 @@ sub run { $self->controller->track_progress(progress => 80); - $self->controller->data([ pairwise { { object => $a, raw_data => $b, errors => [], information => [], info_data => {} } } @objects, @raw_data ]); + $self->controller->data([ pairwise { { object => $a, raw_data => $b, errors => [], information => [], info_data => {} } } @$objects, @raw_data ]); $self->controller->track_progress(progress => 90); diff --git a/SL/Controller/CsvImport/BaseMulti.pm b/SL/Controller/CsvImport/BaseMulti.pm index 7650938e0..973a4ae8e 100644 --- a/SL/Controller/CsvImport/BaseMulti.pm +++ b/SL/Controller/CsvImport/BaseMulti.pm @@ -70,7 +70,7 @@ sub run { $self->controller->raw_data_headers($raw_data_headers); $self->controller->info_headers($info_headers); - my @objects = $self->csv->get_objects; + my $objects = $self->csv->get_objects; $self->controller->track_progress(progress => 70); @@ -78,7 +78,7 @@ sub run { $self->controller->track_progress(progress => 80); - $self->controller->data([ pairwise { { object => $a, raw_data => $b, errors => [], information => [], info_data => {} } } @objects, @raw_data ]); + $self->controller->data([ pairwise { { object => $a, raw_data => $b, errors => [], information => [], info_data => {} } } @$objects, @raw_data ]); $self->controller->track_progress(progress => 90); diff --git a/SL/Helper/Csv.pm b/SL/Helper/Csv.pm index c4a8aefa2..88e61cb63 100644 --- a/SL/Helper/Csv.pm +++ b/SL/Helper/Csv.pm @@ -77,7 +77,7 @@ sub get_objects { croak 'must parse first' unless $self->_parsed; $self->_make_objects unless $self->_objects; - return wantarray ? @{ $self->_objects } : $self->_objects; + return $self->_objects; } sub errors { @@ -360,7 +360,7 @@ SL::Helper::Csv - take care of csv file uploads my $status = $csv->parse; my $hrefs = $csv->get_data; - my @objects = $csv->get_objects; + my $objects = $csv->get_objects; my @errors = $csv->errors; @@ -421,7 +421,7 @@ Do the actual work. Will return true ($self actually) if success, undef if not. Parse the data into objects and return those. -This method will return list or arrayref depending on context. +This method will return an arrayref of all objects. =item C -- 2.20.1