EPrints Technical Mailing List Archive
Message: #00838
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: Random question: Eprint core fields
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Re: Random question: Eprint core fields
- From: Sebastien Francois <sf2@ecs.soton.ac.uk>
- Date: Wed, 04 Jul 2012 16:19:39 +0100
Yuri, This will work: print $eprint->get_value( 'creators' )->[0]; Or: print $eprint->get_value( 'creators' )->[0]->{name}->{given}; (but that's not very pretty! :-)) Perhaps you're confusing array and array refs: my @array = ( 'hello', 'world' ); my $arrayref = [ 'hello', 'world' ]; # both prints 'hello': print $array[0]; print $arrayref->[0]; Seb. On 04/07/12 16:12, Yuri wrote:
I agree. I perl you can have an array, but [0] return error. If you cicle on it, you get the results. You can try it with $eprint->get_value( 'creators' )[0]<- does not work returning $eprint->get_value( 'creators' ) gives an ARRAY *hex number* foreach my $c ( @{$creators} ) works. I don't know why :-)
- References:
- [EP-tech] Random question: Eprint core fields
- From: John Salter <J.Salter@leeds.ac.uk>
- [EP-tech] Re: Random question: Eprint core fields
- From: Ian Stuart <Ian.Stuart@ed.ac.uk>
- [EP-tech] Re: Random question: Eprint core fields
- From: Sebastien Francois <sf2@ecs.soton.ac.uk>
- [EP-tech] Re: Random question: Eprint core fields
- From: John Salter <J.Salter@leeds.ac.uk>
- [EP-tech] Re: Random question: Eprint core fields
- From: Yuri <yurj@alfa.it>
- [EP-tech] Random question: Eprint core fields
- Prev by Date: [EP-tech] Re: Random question: Eprint core fields
- Next by Date: [EP-tech] Re: Random question: Eprint core fields
- Previous by thread: [EP-tech] Re: Random question: Eprint core fields
- Next by thread: [EP-tech] Re: Random question: Eprint core fields
- Index(es):