On Jun 12, 9:37 am, [EMAIL PROTECTED] (Christopher Morgan) wrote:
> I have a complex array containing references to hashes. Some of the hash
> keys point to anonymous lists. A typical element from this array looks like
> this:
>
> {
>
>      '_is_control_field' => '',
>
>      '_ind2' => '0',
>
>      '_subfields' => [
>
>                          'a',
>
>                          'Japanese paper folding'
>
>                      ],
>
>      '_warnings' => [],
>
>      '_tag' => 450,
>
>      '_ind1' => ' '
>
> };
>
> Since this is the first array element, to access the second item in the list
> that "_subfields" points to, I use this syntax:
>
> $fields[0] {'_subfields'}->[1];
>
> This returns 'Japanese paper folding.'
>
> This list can vary in size from element to element, so I would like a way to
> refer to the list in scalar context to get its size. How do I do that?
>
> (My current approach is to simply iterate through the list, pushing the
> elements onto another array until I reach "undefined".)
>
> Many thanks!
>
> - Chris Morgan

It looks like you have a MARC::Field object.  Have you studied the
docs
for MARC::Record? (http://search.cpan.org/dist/MARC-Record/)

--
Brad


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to