The described problem (no 'OK' is printed) persists on Parrot but works fine on
Moar and JVM:
$ perl6-p -e 'sub foo { LEAVE { say "OK" }; die "died" }; foo()' 2>/dev/null
$ perl6-m -e 'sub foo { LEAVE { say "OK" }; die "died" }; foo()' 2>/dev/null
OK
$ perl6-j -e 'sub foo { LEAVE { say "OK" }; di
# New Ticket Created by Tadeusz SoĊnierz
# Please include the string: [perl #118387]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org:443/rt3/Ticket/Display.html?id=118387 >
S04 says:
LEAVE {...} [executes] at every block exit time (even stack unwind