2 A proposed perl data structure for storing marc info
5 $record is a hash reference
11 $tags is a hash reference
18 $tag->{indicator}='04'
20 $tag->{subfields}=$subfields
23 $subfields->{1}=$subfield
24 $subfields->{2}=$subfield
25 $subfields->{3}=$subfield
27 $subfield is a hash reference
30 $subfield->{value}='MacDonald, John A.'
32 This takes care of possible repeating tags and subfields as well as ordering of
33 tags and subfields, but it makes it difficult to look up specific tags and
34 subfields without looping through every time. It might be an idea to add an
35 index to the structure to aid these lookups.
37 $record->{index}->{110}->{tags}=\(3,4) <-- array ref shows that tags 3 and 4
40 Need a similar index for subfields.... I'm not sure if this is any simpler than
41 just looping through the tags every time. :)
43 I think looping is the way to go...
45 This still needs more work. This will also require an API for accessing or
46 modifying this structure, as it is non-trivial to parse the data. I'm also
47 starting to wonder how difficult it is going to be to develop templates using
48 this kind of structure. HTML::Template has no facility for parsing this kind
49 of data structure. We might need an alternate (or completely different) data
50 structure that is parseable by HTML::Template.