Script attempted to create global variable
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to load one script into redis that will export functions that future scripts executed will depend on, but attempt to define global function fails, same goes for global variables: redis 127.0.0.1:6379> EVAL "function alex() return 3.1415 end" 0 (error) ERR Error running script (call to f_f24a5a054d91ccc74c2629e113f8f639bbedbfa2): user_script:1: Script attempted to create global variable 'alex' How can I define global functions and variables ? 回答1: Looking at the source code in file scripting.c /* This function installs