EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #10065
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] EPC: calling a function stored in nested config hash
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: [EP-tech] EPC: calling a function stored in nested config hash
- From: John Salter <J.Salter@leeds.ac.uk>
- Date: Thu, 27 Mar 2025 16:34:25 +0000
CAUTION: This e-mail originated outside the University of Southampton.
Hi, The method is something like this: $c->{hefce_oa}->{deduce_panel} = sub { my( $eprint ) = @_; # do stuff return “A value”; }; I can get the function itself e.g. adding this to the workflow: <component type="XHTML"> <epc:print expr="$config{hefce_oa}{deduce_panel}()"/> </component> Results in: CODE(0x5595701ec338) This makes sense – as you can get a ‘value’ from the nested config [2]. I’m trying to find a way to call this method. If I try other combinations of brackets/dots/ <epc:print expr="$config{hefce_oa}{deduce_panel}.($item)"/> <epc:print expr="{$config{hefce_oa}{deduce_panel}}.($item)"/> I either get the code reference, or an EPScript error. Am I overlooking something? Is there a way to do this? Or should I just inject a new run_eprint_deduce_panel wrapper method into EPrints::Script::Compiled? Cheers, John [1]
https://wiki.eprints.org/w/EPScript/Data_Types#Hashes [2]
https://wiki.eprints.org/w/EPScript/Introduction John Salter https://orcid.org/0000-0002-8611-8266 White Rose Libraries Technical Officer |
- Follow-Ups:
- Re: [EP-tech] EPC: calling a function stored in nested config hash
- From: David Newman <drn@ecs.soton.ac.uk>
- Re: [EP-tech] EPC: calling a function stored in nested config hash
- Prev by Date: RE: [EP-tech] Creators, authors, editors names
- Next by Date: Re: [EP-tech] EPC: calling a function stored in nested config hash
- Previous by thread: [EP-tech] Links dynamically generated lose the "/cgi" part
- Next by thread: Re: [EP-tech] EPC: calling a function stored in nested config hash
- Index(es):