Subject: | problems with new field creation |
Date: | Sat, 19 Sep 2009 17:32:21 -0700 |
To: | bug-MARC-Record [...] rt.cpan.org |
From: | Jacob Roche <jacob.roche [...] gmail.com> |
Hi, I'm having some problems making new fields. Namely, I'm trying to
build a 020 field, and it simply isn't working. I'll use a bit of code
like:
if ($MARC_page =~ m{
(?:020<)? # MARC code followed by a bracket to identify
.*? # followed by anything
\|a\s # followed by a pipe and the subfield
(\d{13}) # followed by a 13-digit ISBN code
}xmgs) {
my $isbn = MARC::Field->new('020', 'a' => $1);
}
and I get the error: "Field 020 must have at least one subfield at
getDavisRecord.pl line 75". I've tested and made sure that $1 is
equal to a 13 digit ISBN code, so there's no issue there. And clearly
I am giving field 020 at least one subfield. I've tried even copying
your sample code (you used a 245 tag with two indicators, so I removed
the indicators and changed it to 020) and it still gives me the error.
I'm not sure how to convince it that it does in fact have a subfield.
Any help would be much appreciated, and thank you for creating this
module in the first place.
Best regards,
Jacob Roche