sub NAME PROTO ATTRS BLOCK# Named, prototype, attributes, definition sub NAME ATTRS BLOCK # Named, attributes, definition sub NAME PROTO BLOCK # Named, prototype, definition sub NAME BLOCK # Named, definition sub NAME PROTO ATTRS # Named, prototype, attributes sub NAME ATTRS # Named, attributes sub NAME PROTO # Named, prototype sub NAME # Named sub PROTO ATTRS BLOCK # Anonymous, prototype, attributes, definition sub ATTRS BLOCK # Anonymous, attributes, definition sub PROTO BLOCK # Anonymous, prototype, definition sub BLOCK # Anonymous, definition
子关键字定义一个新的子程序。遵循这些规则上面显示的参数:
NAME是在子程序的名称。命名子程序可以预先声明(没有相关的代码块),或没有原型规范。
匿名子程序必须有定义。
PROTO定义一个函数,当函数被调用时,将使用验证提供的参数原型。
ATTRS定义的附加信息被声明子程序的解析器。
Nothing