我们将GlobalCommands对象放在第一个屏幕的右上角位置以方便读取和访问,因为这种逐级下降方式会使得这一区域比较适合作全局命令使用。
We placed the GlobalCommands object on the top right hand corner of the first screen for easier readability and accessibility, because the step-down approach leaves this area available for this use.
下面,您为要执行的命令设置一些全局变量,为响应消息设置一个缓冲区,并设置一个哈希来包含来自触发器消息的字段(见清单4)。
Next, you set up global variables for the command to be executed, a buffer for response messages, and a hash that will contain the fields from the trigger message (Listing 4).
由于命令行中指定了- g选项,将在全局范围内生成散列表。
Because the -g option is specified from the command line, the hash table is generated in global scope.
应用推荐