"type must be 'xml' or 'json'" unless grep { $_[0] eq $_ } qw(xml json);
},
lazy => 1,
builder => sub {
($_[0]->file and $_[0]->file =~ /\.json$/) ? 'json' : 'xml';
}
);
sub
.11 of MODS::Record utf8 is enabled by issuing JSON->new->utf8(1)
if($MODS::Record::VERSION >= 0.11){
if($self->type eq "json"){
$self->fh->binmode(":ra
eq "json"){
$self->fh->binmode(':utf8');
}
}
my $m = $self->type eq "xml" ? MODS::Record->from_xml($self->fh) : MODS::Record->from_json($se