From 91d174462f7ba5ed38082c4a23eaef98febac786 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 19 Nov 2008 16:03:50 +0100 Subject: [PATCH] [REPLACE previous] Removing map calls in void context Thanks Joe. Signed-off-by: Henri-Damien LAURENT --- 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 7751a1013c..089ce20903 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -797,7 +797,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) { @@ -1181,11 +1185,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 ad12dda116..7b868f8166 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -1798,9 +1798,9 @@ sub HasSubscriptionExpired { my ($res) = $sth->fetchrow ; 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