EPrints Technical Mailing List Archive
Message: #00736
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: Can_call for nested config
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Re: Can_call for nested config
- From: Sebastien Francois <sf2@ecs.soton.ac.uk>
- Date: Fri, 15 Jun 2012 16:39:41 +0100
You need to pass the path to your sub() as an array ref so: $repo->call( [ 'ethos', $institution, 'thesis_type_match' ], 'some data' ); Seb. On 15/06/12 16:28, John Salter wrote:
OK - it looks like the can_call works OK, but actually calling (with some data) it doesn't. Doing this: if ( $repository->can_call( 'ethos', $institution, 'thesis_type_match' ) ){ print "CAN CALL!\n"; print $repository->call( 'ethos', $institution, 'thesis_type_match', 'some data' ); } Results in: CAN CALL! Undefined or invalid function: ethos Any clues? Cheers, John -----Original Message----- From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Sebastien Francois Sent: 15 June 2012 16:03 To: eprints-tech@ecs.soton.ac.uk Subject: [EP-tech] Re: Can_call for nested config Hi, I've copied / pasted your example which just works on my local 3.3.9 install. Try debugging perl_lib/Repository.pm::can_call and see where it fails. Seb. On 15/06/12 15:44, John Salter wrote:I'm trying to do things the *right* way, using can_call I have a config file that includes something like: my $ethos = {}; $c->{ethos} = $ethos; $ethos->{'leeds'}->{'thesis_type_match'} = sub { #stuff }; $ethos->{'sheffield'}->{'thesis_type_match'} = sub { #other stuff }; In my code, I'm trying to do something like: $institution= 'leeds'; if ( $repository->can_call( 'ethos', $institution, 'thesis_type_match' ) ){ #stuff }; But it isn't working. Should I be able to do this? If I just use: $c->{'thesis_type_match'} = sub { #stuff } It works - but that would mean config wasn't contained in 'ethos'..?*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech *** Archive: http://www.eprints.org/tech.php/ *** EPrints community wiki: http://wiki.eprints.org/ *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech *** Archive: http://www.eprints.org/tech.php/ *** EPrints community wiki: http://wiki.eprints.org/
- References:
- [EP-tech] Can_call for nested config
- From: John Salter <J.Salter@leeds.ac.uk>
- [EP-tech] Re: Can_call for nested config
- From: Sebastien Francois <sf2@ecs.soton.ac.uk>
- [EP-tech] Re: Can_call for nested config
- From: John Salter <J.Salter@leeds.ac.uk>
- [EP-tech] Can_call for nested config
- Prev by Date: [EP-tech] Re: Can_call for nested config
- Next by Date: [EP-tech] MePrints
- Previous by thread: [EP-tech] Re: Can_call for nested config
- Next by thread: [EP-tech] MePrints
- Index(es):