sub mfhd_to_hash {
my ($self, $mfhd_xml) = @_;
- my $location;
+ my $location = '';
my $holdings = [];
my $supplements = [];
my $indexes = [];
my $marc = MARC::Record->new_from_xml($mfhd_xml);
my $mfhd = MFHD->new($marc);
- foreach my $subfield_ref ($marc->field('852')->subfields) {
- my ($subfield, $data) = @$subfield_ref;
- $location .= $data . " -- ";
+ foreach my $field ($marc->field('852')) {
+ foreach my $subfield_ref ($field->subfields) {
+ my ($subfield, $data) = @$subfield_ref;
+ $location .= $data . " -- ";
+ }
}
$location =~ s/ -- $//;