You cannot currently export dynamic variables that way, and maybe we never will.
In the meantime, since this is usually in the context of Command Line scripts, there is a way around this:
# in your module:
PROCESS::<%SUB-MAIN-OPTS><named-anywhere> = True;
# in your script
dd %*SUB-MAIN-OPTS'
# Hash element = ${:named-anywhere}
What you're doing there is that your setting the named-anywhere
key in the %SUB-MAIN-OPTS
hash that lives in the PROCESS::
namespace. That is the outer namespace in which dynamic variables are looked up if they cannot be found anywhere else in the stack. Note that the assignment to the key named-anywhere
will actually vivify the hash if it doesn't exist yet. So this will not interfere with any other future additions to the %SUB-MAIN-OPTS
hash.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…