Perl 中使用 local 声明一个局部变量,这引入了动态作用域
sub a { local $x = 42; b(); } sub b { print $x; } a(); # OUTPUT: # 42