sub outer { my ($param) = @_; local *inner1 = sub { ... }; local *inner2 = sub { ... }; ... inner2(inner1($param)); }