Description
Perl code can register cleanup blocks that run when a scope ends. This helps developers release temporary resources, restore state, close handles, or undo setup work reliably.
It is a resource-management library. Cleanup code should be small and predictable because it may run during error paths as well as normal execution.