| 1 | package MARC::Validator::Filter::Plugin::AACR2; | ||
| 2 | |||
| 3 | 3 | ▶ | use base qw(MARC::Validator::Filter::Abstract); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | use strict; | ||
| 5 | use warnings; | ||
| 6 | |||
| 7 | use English; | ||
| 8 | use MARC::Leader 0.08; | ||
| 9 | |||
| 10 | our $VERSION = 0.01; | ||
| 11 | |||
| 12 | sub name { | ||
| 13 | my $self = shift; | ||
| 14 | |||
| 15 | return 'aacr2'; | ||
| 16 | } | ||
| 17 | |||
| 18 | sub process { | ||
| 19 | my ($self, $marc_record) = @_; | ||
| 20 | |||
| 21 | my $leader_string = $marc_record->leader; | ||
| 22 | my $leader = eval { | ||
| 23 | MARC::Leader->new( | ||
| 24 | 'verbose' => $self->{'verbose'}, | ||
| 25 | )->parse($leader_string); | ||
| 26 | }; | ||
| 27 | if ($EVAL_ERROR) { | ||
| 28 | return; | ||
| 29 | } | ||
| 30 | if ($leader->descriptive_cataloging_form ne 'a') { | ||
| 31 | return; | ||
| 32 | } | ||
| 33 | |||
| 34 | return 'aacr2'; | ||
| 35 | } | ||
| 36 | |||
| 37 | 1; | ||
| 38 | |||
| 39 | __END__ | ||