foreach my $strip_value (@{$opts{strip}}) {
my $trec = {};
if ($strip_value =~ /\//) {
- $trec->{tag} = $`;
- $trec->{tag} = "..." if ($` eq "");
-
+ $trec->{tag} = $`;
+ $trec->{tag} = "..." if ($` eq "");
$trec->{subfield} = $';
$trec->{subfield} = "." if ($' eq "");
} else {
# No slash case
- $trec->{tag} = $strip_value;
+ $trec->{tag} = $strip_value;
$trec->{subfield} = '';
}
push @strip, $trec;
my $subfieldRE = $strip_ref->{subfield};
if ( $subfieldRE eq "") {
- # Case 1: Field only check, e.g. "--strip 5.[0,1]"
- # If the supplied regexp matches the field, then
- # delete that field.
- foreach my $test_field ($marc->fields()) {
- if ($test_field->tag() =~ /$tagRE/) {
- # A hit!
- $marc->delete_field($test_field);
- }
-
- }
+ # Case 1: Field only check, e.g. "--strip 5.[0,1]"
+ # If the supplied regexp matches the field, then
+ # delete that field.
+ foreach my $test_field ($marc->fields()) {
+ if ($test_field->tag() =~ /$tagRE/) {
+ # A hit!
+ $marc->delete_field($test_field);
+ }
+ }
} elsif ($subfieldRE ne "" && $tagRE ne "") {
# Case 2: Field & subfield supplied.
# Note a blank tag will be wildcarded to "*".
# Traverse fields, then traverse subfields if match
# is found.
- foreach my $test_field ($marc->fields()) {
- if ( !$test_field->is_control_field() &&
- $test_field->tag() =~ /$tagRE/) {
- # Traverse all subfields:
- foreach my $test_subfield ($test_field->subfields()) {
- my $sfcode = @{$test_subfield}[0];
- if ($sfcode =~ /$subfieldRE/) {
- $test_field->delete_subfield($sfcode);
- }
- }
- }
- }
-
- }
+ foreach my $test_field ($marc->fields()) {
+ if ( !$test_field->is_control_field() &&
+ $test_field->tag() =~ /$tagRE/) {
+ # Traverse all subfields:
+ foreach my $test_subfield ($test_field->subfields()) {
+ my $sfcode = @{$test_subfield}[0];
+ if ($sfcode =~ /$subfieldRE/) {
+ $test_field->delete_subfield($sfcode);
+ }
+ }
+ }
+ }
+ }
}
-
+
if ($Marque::config->option_value('items')) {
my @acps = $self->acps_for_bre($r);
foreach my $acp (@acps) {
my $subfieldRE = $strip_ref->{subfield};
if ( $subfieldRE eq "") {
- # Case 1: Field only check, e.g. "--strip 5.[0,1]"
- # If the supplied regexp matches the field, then
- # delete that field.
- foreach my $test_field ($marc->fields()) {
- if ($test_field->tag() =~ /$tagRE/) {
- # A hit!
- $marc->delete_field($test_field);
- }
-
- }
+ # Case 1: Field only check, e.g. "--strip 5.[0,1]"
+ # If the supplied regexp matches the field, then
+ # delete that field.
+ foreach my $test_field ($marc->fields()) {
+ if ($test_field->tag() =~ /$tagRE/) {
+ # A hit!
+ $marc->delete_field($test_field);
+ }
+ }
} elsif ($subfieldRE ne "" && $tagRE ne "") {
- # Case 2: Field & subfield supplied.
- # Note a blank tag will be wildcarded to "*".
- # Traverse fields, then traverse subfields if match
- # is found.
- foreach my $test_field ($marc->fields()) {
+ # Case 2: Field & subfield supplied.
+ # Note a blank tag will be wildcarded to "*".
+ # Traverse fields, then traverse subfields if match
+ # is found.
+ foreach my $test_field ($marc->fields()) {
if ( !$test_field->is_control_field() &&
- $test_field->tag() =~ /$tagRE/) {
+ $test_field->tag() =~ /$tagRE/) {
# Traverse all subfields:
foreach my $test_subfield ($test_field->subfields()) {
- my $sfcode = @{$test_subfield}[0];
- if ($sfcode =~ /$subfieldRE/) {
+ my $sfcode = @{$test_subfield}[0];
+ if ($sfcode =~ /$subfieldRE/) {
$test_field->delete_subfield($sfcode);
- }
+ }
}
- }
- }
-
+ }
+ }
}
}
+
if ($Marque::config->option_value('since')) {
my $leader = $marc->leader();
if ($U->is_true($r->deleted())) {