Hi Shelley, Just as another option: you don't necessarily need to write a new module to do this. I have a similar situation (verifying the presence of an 856 field(s) as well as other fields). I just use the MARC::File::USMARC module to read through each record in the .mrc file and look for the specific fields/indicators that I want.
/amy Amy A. Dobrowolsky, Metadata Librarian, KnowledgeWorks Provider Data Acquisitions & Integration Serials Solutions | 501 N. 34th Street, Ste. 300 | Seattle, WA 98103 USA | 1.866.737.4257 extension 1038 amy.dobrowol...@serialssolutions.com www.serialssolutions.com -----Original Message----- From: Shelley Doljack [mailto:sdolj...@stanford.edu] Sent: Thursday, July 19, 2012 4:12 PM To: Bryan Baldus Cc: perl4lib@perl.org Subject: Re: Customizing MARC::Errorchecks Hi Bryan, Thanks for the information. I also downloaded Lintadditions. Right now, I'm trying to figure out what I want to do. I'm new to object-oriented programming in Perl, so it's a learning experience for me. What I think I need to do is create my own module for checks specific to ebook records, like checking that all records have an 856 field with 2nd indicator 0 or an electronic resource 007, among other things. I need to think about it more and play around with the different modules more. Thanks, Shelley ----- Original Message ----- > From: "Bryan Baldus" <bryan.bal...@quality-books.com> > To: "Shelley Doljack" <sdolj...@stanford.edu>, perl4lib@perl.org > Sent: Tuesday, July 17, 2012 6:15:45 PM > Subject: RE: Customizing MARC::Errorchecks > > On Tuesday, July 17, 2012 4:34 PM, Shelley Doljack > [sdolj...@stanford.edu] wrote: > >I'm playing around with using MARC::Errorchecks for reviewing ebook > >records we get from vendors. I want to make some modifications to the > >module, but I find that if I do so in a similar manner described in > >the tutorial for customizing MARC::Lint, by making a subclass of the > >module, it doesn't work. Is this not possible with Errorchecks? > > Indeed, MARC::Errorchecks was not written in the object-oriented style > that MARC::Lint uses. Skimming through the code just now (I've not > worked with it as regularly as I might like to be able to keep it > fresh in my memory), I believe it is essentially a collection of subs > with a wrapper sub to call each check--check_all_subs() calls each of > the checking subroutines and returns the arrayref of any errors found. > When I wrote it I was still early in learning Perl (and while I've > gotten better since then, lack of recent practice working with it > hasn't necessarily improved my knowledge of the language), so I'm sure > it's not the most optimized code possible. > check_all_subs() and the POD comments could serve as an index to each > of the checks, with the SYNOPSIS showing examples of how to call the > individual checks. > > That said, if you have ideas for additions or changes, or other > questions, I welcome hearing about them, either to add to the base > module or to help with creating a related module of your own. I do > know that I need to get working on the changes required for RDA > records, but haven't really even started looking into the challenges > those will pose (though that will likely result in a new module or > more devoted just to RDA, and will also likely require > changes/subclasses to MARC::Lint and MARC::Lintadditions). > > Also of note, I have a newer version I've just uploaded to CPAN [1] > with the following changes (in addition to those listed below, I plan > on removing MARC::Lint::CodeData from the Errorchecks distribution and > then requiring MARC::Lint, which includes CodeData (to hopefully > resolve issues with installing both module packages at the same time > due to this file): > > Version 1.16: Updated May 16-Nov. 14, 2011. Released 7-17-2012. > -Removed MARC::Lint::CodeData and require MARC::Lint -Turned off > check_fieldlength($record) in check_all_subs() -Turned off checking > of floating hyphens in 520 fields in > findfloatinghyphens($record) > -Updated validate008 subs (and 006) related to 008/24-27 (Books and > Continuing Resources) for MARC Update no. 10, Oct. 2009 and Update > no. 11, 2010; no. 12, Oct. 2010; and no. 13, Sept. 2011. > -Updated %ldrbytes with leader/18 'c' and redefinition of 'i' per > MARC Update no. 12, Oct. 2010. > > Version 1.15: Updated June 24-August 16, 2009. Released , 2009. > > -Updated checks related to 300 to better account for electronic > resources. > -Revised wording in validate008($field008, $mattype, $biblvl) > language code (008/35-37) for ' '/zxx. > -Updated validate008 subs (and 006) related to 008/24-27 (Books and > Continuing Resources) for MARC Update no. 9, Oct. 2008. > -Updated validate008 sub (and 006) for Books byte 33, Literary form, > invalidating code 'c' and referring it to 008/24-27 value 'c' . > -Updated video007vs300vs538($record) to allow Blu-ray in 538 and 's' > in 07/04. > > [1] While the CPAN indexer works on that: > <http://www.cpan.org/authors/id/E/EI/EIJABB/MARC-Errorchecks-1.16.tar. > gz> , I've also posted the file to my website: > <http://home.comcast.net/~eijabb/bryanmodules/MARC-Errorchecks-1.16.ta > r.gz>, with text versions of each file visible in: > <http://home.comcast.net/~eijabb/bryanmodules/MARC-Errorchecks-1.16> > > ##################### > > Finally, I meant to mention it on this list earlier, but I've posted a > new version of MARC::Lint, 1.45, to CPAN [2], with the current > development version (as of now, same as CPAN's version), in > SourceForge's Git repository [3]. Updates to that module include: > - Updated Lint::DATA section with Update No. 10 (Oct. 2009) through > Update No. 14 (Apr. 2012) > - Updated _check_article with the exceptions: 'A & ', 'L is ' > > ##################### > > [2] <http://search.cpan.org/~eijabb/MARC-Lint-1.45/> > [3] > <http://marcpm.git.sourceforge.net/git/gitweb.cgi?p=marcpm/marcpm;a=su > mmary> > > I hope this helps, > > Bryan Baldus > Cataloger > Quality Books Inc. > 1-800-323-4241x402 > bryan.bal...@quality-books.com > eij...@cpan.org > http://home.comcast.net/~eijabb/