From: Jason Stephenson Date: Mon, 11 Apr 2016 14:39:02 +0000 (-0400) Subject: LP 1768715: Simplify Open-ILS/src/support-scripts/pingest.pl with selectcol_arrayref. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1f2f392b42c5e1e10488d2034a0686c7e8768ad4;p=evergreen%2Fpines.git LP 1768715: Simplify Open-ILS/src/support-scripts/pingest.pl with selectcol_arrayref. By switching to DBI->selectcol_arrayref in pingest.pl, we can avoid having to check for references in the main loop. This eliminates an extra variable and an extra line of code that are no longer needed. Signed-off-by: Jason Stephenson Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/support-scripts/pingest.pl b/Open-ILS/src/support-scripts/pingest.pl index 9c9252857b..8389c5328c 100755 --- a/Open-ILS/src/support-scripts/pingest.pl +++ b/Open-ILS/src/support-scripts/pingest.pl @@ -152,12 +152,11 @@ if ($opt_pipe) { } } else { my $dbh = DBI->connect('DBI:Pg:'); - @input = @{$dbh->selectall_arrayref($q)}; + @input = @{$dbh->selectcol_arrayref($q)}; $dbh->disconnect(); } -foreach my $r (@input) { - my $record = (ref($r)) ? $r->[0] : $r; +foreach my $record (@input) { push(@blist, $record); # separate list of browse-only ingest push(@$records, $record); if (++$count == $batch_size) {