Bug 11478: Replace experimental given/when keywords
The keywords given and when are flagged experimental in perl 5.18 and subject to change. This patch replaces the construct by an if/elsif To test: [1] Verify that prove -v t/SimpleMARC.t passes. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
parent
48298fe494
commit
08d15a6fd1
1 changed files with 9 additions and 11 deletions
|
@ -89,22 +89,20 @@ sub copy_field {
|
|||
if grep {/$modifier/} @available_modifiers;
|
||||
}
|
||||
foreach my $value (@values) {
|
||||
for ( $modifiers ) {
|
||||
when ( /^(ig|gi)$/ ) {
|
||||
if ( $modifiers =~ m/^(ig|gi)$/ ) {
|
||||
$value =~ s/$regex->{search}/$regex->{replace}/ig;
|
||||
}
|
||||
when ( /^i$/ ) {
|
||||
elsif ( $modifiers eq 'i' ) {
|
||||
$value =~ s/$regex->{search}/$regex->{replace}/i;
|
||||
}
|
||||
when ( /^g$/ ) {
|
||||
elsif ( $modifiers eq 'g' ) {
|
||||
$value =~ s/$regex->{search}/$regex->{replace}/g;
|
||||
}
|
||||
default {
|
||||
else {
|
||||
$value =~ s/$regex->{search}/$regex->{replace}/;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
update_field( $record, $toFieldName, $toSubfieldName, $dont_erase, @values );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue