# 5.36 - defer blocks use v5.36; use experimental qw/ defer /; sub foo { defer { say "this happens at the end of the scope" } say "start"; say "end"; } foo(); say "After foo()";