Subject: | Enhancement to allow MARC::Field delete_subfield to match code on regexp |
Date: | Sat, 14 Sep 2013 12:45:41 -0400 |
To: | bug-MARC-Record [...] rt.cpan.org |
From: | Jason Stephenson <jstephenson [...] mvlc.org> |
While processing a batch of records from a new member or other third
party vendor, it is helpful to get rid of crud. However, I found myself
wanting to get rid of any subfields with invalid codes, regardless of
their content. The MARC documentation says: "Data element identifiers
are lowercase alphabetic or numeric characters."
This was rather difficult to implement, since I would need to specify an
array of every possible character but a-z and 0-9 for the
delete_subfield call. I realized the fastest way to do this would be to
write:
$field->delete_subfield(code => qr/[^a-z0-9]/);
The attached patch makes this possible and includes the new usage in the
POD.
I have attached a patch to add this behavior to MARC::Field. I also
certify that I wrote the code myself and have every right to submit on
behalf of myself and my employer.
--
Jason Stephenson
Assistant Director for Technology Services
Merrimack Valley Library Consortium
Message body is not shown because sender requested not to inline it.