|
|
@ -208,6 +208,20 @@ sub access_chain |
|
|
|
# On the last key of the chain; try to execute the subroutine if it exists |
|
|
|
# On the last key of the chain; try to execute the subroutine if it exists |
|
|
|
if ($is_last_key) |
|
|
|
if ($is_last_key) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
# Go through each argument and replace any 'anvil->' strings with their real value. |
|
|
|
|
|
|
|
# At the time of writing, the only expected use case is calling $anvil->_make_hash_reference |
|
|
|
|
|
|
|
for my $arg_i (0 .. $#{$chain_args}) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
my $arg = $chain_args->[$arg_i]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($arg =~ s/^anvil(->|\.)//) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
my ($replacement) = access_chain({ chain => $arg, debug => $debug }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$chain_args->[$arg_i] = $replacement; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Trailing 1 means the eval block will return success if the subroutine and assign succeeded |
|
|
|
# Trailing 1 means the eval block will return success if the subroutine and assign succeeded |
|
|
|
eval { (@results) = $intermediate->${key}(@$chain_args); 1; }; |
|
|
|
eval { (@results) = $intermediate->${key}(@$chain_args); 1; }; |
|
|
|
|
|
|
|
|
|
|
|