参考
示例

参考

示例

#!/usr/bin/perl

print "pid = $$\n";
print "yStart main running here\n";

BEGIN   { print "BEGIN\n"; }
INIT    { print "INIT\n";  }
CHECK   { print "CHECK\n"; }
END     { print "END\n";   }
BEGIN
运行程序之前执行的模块 ( Run some code as soon as it has all been read in by the parser and before the rest compiles.)
END
结束程序之前执行的模块 (Run some code as late as possible. When the interpreter is ready to shut down.)