in reply to my $var

A lexical (my) variable get cleared when exiting the tightest lexical scope (curlies or file) in which it is found.

sub f { my $x = ...; { my $y = ...; ... # $y cleared here. } ... # $x cleared here. }

It doesn't matter how the scope is exited. It'll get cleared on return, die, next, etc.

You obviously didn't read the documentation for $|.