From 6c5f9d46d8cca0da6db671bc345e232eeda54660 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Sat, 22 Nov 2008 22:23:28 +0100 Subject: [PATCH] Removing map calls in void context Thanks Joe. Signed-off-by: Galen Charlton --- C4/AuthoritiesMarc.pm | 10 +++++++--- C4/Serials.pm | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 2837a855fe..2b792b541f 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -833,7 +833,11 @@ sub FindDuplicateAuthority { # build a request for SearchAuthorities my $query='at='.$authtypecode.' '; my $filtervalues=qr([\001-\040\!\'\"\`\#\$\%\&\*\+,\-\./:;<=>\?\@\(\)\{\[\]\}_\|\~]); - map {$_->[1]=~s/$filtervalues/ /g; $query.= " and he,wrdl=\"".$_->[1]."\"" if ($_->[0]=~/[A-z]/)} $record->field($auth_tag_to_report)->subfields() if $record->field($auth_tag_to_report); + if ($record->field($auth_tag_to_report)) { + foreach ($record->field($auth_tag_to_report)->subfields()) { + $_->[1]=~s/$filtervalues/ /g; $query.= " and he,wrdl=\"".$_->[1]."\"" if ($_->[0]=~/[A-z]/); + } + } my ($error, $results, $total_hits)=SimpleSearch( $query, 0, 1, [ "authorityserver" ] ); # there is at least 1 result => return the 1st one if (@$results>0) { @@ -1217,11 +1221,11 @@ sub merge { $rq->execute; while (my $biblionumbers=$rq->fetchrow){ my @biblionumbers=split /;/,$biblionumbers; - map { + foreach (@biblionumbers) { my $biblionumber=$1 if ($_=~/(\d+),.*/); my $marc=GetMarcBiblio($biblionumber); push @reccache,$marc; - } @biblionumbers; + } } } else { #zebra connection diff --git a/C4/Serials.pm b/C4/Serials.pm index 90db643af3..e087012ec3 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -1806,9 +1806,9 @@ sub HasSubscriptionExpired { return 0 unless $res; my @res=split (/-/,$res); my @endofsubscriptiondate=split(/-/,$expirationdate); - map{ + foreach (@res,@endofsubscriptiondate){ return 2 unless $_ ; - } (@res,@endofsubscriptiondate); + } return 1 if ( (@endofsubscriptiondate && Delta_Days($res[0],$res[1],$res[2], $endofsubscriptiondate[0],$endofsubscriptiondate[1],$endofsubscriptiondate[2]) <= 0) || (!$res)); -- 2.39.5