Converting MARC fields with Catmandu - repeated subfields being squished together.

[email protected] (Robin Sheat) Fri, 06 Jun 2014 15:11:24 +1200
Newsgroups perl.perl4lib
Organization Catalyst IT Ltd.
Message-ID <[email protected]>
--=-oUPBvZfNPcEyYhrN6zLb
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I'm using catmandu to JSON-ise MARC records for storage in
Elasticsearch, and seem to have come up with something that I can't
readily see how to fix (without getting down and dirty with fixers.)

I have a record that has this:

["650"," ","0","a","Time","v","Pictorial works","v","Juvenile
literature.","9","15531"]

and a mapping:

marc_map('650v', 'subject.$append')

This works well enough in most cases, however when the subfield is
doubled up, I end up with:

"subject":["Time","Pictorial worksJuvenile literature."]

The $append doesn't seem to apply in this case. This only seems to
happen to repeats within a field, other 650$v subfields are in their own
strings, though suffer the same problem.

Is this a bug in Catmandu-MARC? I've tried reading the marc_map.pl file,
but the lack of internal documentation, and the nature of what it's
doing make it not the easiest thing to understand.

--=20
Robin Sheat
Catalyst IT Ltd.
=E2=9C=86 +64 4 803 2204
GPG: 5FA7 4B49 1E4D CAA4 4C38  8505 77F5 B724 F871 3BDF

--=-oUPBvZfNPcEyYhrN6zLb
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)

iQEcBAABCgAGBQJTkTFcAAoJEHf1tyT4cTvf0GcH/ir/s5QWkoYSrhy0o+7sLhBM
NOBFUFyDSGn/otdSOFcpgsKQqyUlkRmZncdZZjQLV8739CGuVHED2uBXckt5f8wa
5UpOgmJmnlKMPFiMkjAzdmRwPZoaEgVLob8oJi2rFD51cwTwIfJx1V9T17x+MjGF
8vm7rqjcRftQnFN6NFd3hmz2PTetvvbtZQpjV3fk6MibleOYhEXbNO/6sSwh0AiA
CTInjoELhyD6Qya85syySWFFa1LbOUboi8vEQ9EPwpnIpp8/s2T/mqFYty3Onkpa
B0S2J9sVf5jGx7DgBxp6RiF+hOo97sk/N7VtKgQpOGgfq07ehZTDxfJ+2iD4xvM=
=BLcs
-----END PGP SIGNATURE-----

--=-oUPBvZfNPcEyYhrN6zLb--