[EP-tech] Can_call for nested config

John Salter J.Salter at leeds.ac.uk
Fri Jun 15 15:44:05 BST 2012


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'..?

Cheers,
John


More information about the Eprints-tech mailing list