Dpkg::Exit(3perl) libdpkg-perl Dpkg::Exit(3perl)

# [NAME](#NAME)

Dpkg::Exit - program exit handlers

# [DESCRIPTION](#DESCRIPTION)

The Dpkg::Exit module provides support functions to run handlers on exit.

# [FUNCTIONS](#FUNCTIONS)

[push\_exit\_handler($func)](#push_exit_handler%28$func%29)

Register a code reference into the exit function handlers stack.

[**pop\_exit\_handler()**](#pop_exit_handler%28%29)

Pop the last registered exit handler from the handlers stack.

[**run\_exit\_handlers()**](#run_exit_handlers%28%29)

Run the registered exit handlers.

# [CHANGES](#CHANGES)

## [Version 2.00 (dpkg 1.20.0)](#Version_2.00_%28dpkg_1.20.0%29)

Hide variable: @handlers.

## [Version 1.01 (dpkg 1.17.2)](#Version_1.01_%28dpkg_1.17.2%29)

New functions: **push\_exit\_handler()**, **pop\_exit\_handler()**, **run\_exit\_handlers()**

Deprecated variable: @handlers

## [Version 1.00 (dpkg 1.15.6)](#Version_1.00_%28dpkg_1.15.6%29)

Mark the module as public.

2026-09-09 1.23.11-dirty

---

Document: Dpkg::Exit(3perl) from dpkg 1.23.11-r0 (Chainguard OS)
Source: https://git.dpkg.org/git/dpkg/dpkg.git
