Seems you just want a complicated way of not writing $_[0] in the sub. That can be done of course. But why would you? And what has this to do with localizing a lexical, which you were asking about in your earlier posts? If you're passing in the parameter to the sub, there's no need to localize anything, is there?
my $f = sub {my $x = shift; sub {$x ** 2}->()};
say $f->(2); # => 4
say $f->(3); # => 9