---
name: "Dpkg::Archive::Ar"
section: "3perl"
platform: "linux"
package: "dpkg"
version: "1.23.11-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Dpkg::Archive::Ar"
---

# Dpkg::Archive::Ar(3perl)

Unix ar archive support

## NAME

Dpkg::Archive::Ar - Unix ar archive support

## DESCRIPTION

This module provides a class to handle Unix ar archives. It support the common format, with no GNU or BSD extensions.

**Note**: This is a private module, its API can change at any time.

## METHODS

- $ar = Dpkg::Archive::Ar-\>new(%opts)

  Create a new object to handle Unix ar archives.

  Options:

  - **filename**

    The filename for the archive to open or create.

  - **create**

    A boolean denoting whether the archive should be created, otherwise if it does not exist the constructor will not open, create or scan it.

- $ar-\>create\_archive($filename)

  Create the archive.

- $ar-\>open\_archive($filename)

  Open the archive.

- $ar-\>**parse\_magic()**

  Reads and parses the archive magic string, and validates it.

- $ar-\>**parse\_member()**

  Reads and parses the archive member and tracks it for later handling.

- $ar-\>skip\_member($member)

  Skip this member to the next one. Get the value of a given substitution.

- $ar-\>**scan\_archive()**

  Scan the archive for all its member files and metadata.

- $ar-\>**get\_members()**

  Get the list of members in the archive.

- $ar-\>extract\_member($member)

  Extract the specified member to the current directory.

- $ar-\>write\_member($member)

  Write the provided `$member` into the archive.

- $ar-\>add\_file($filename)

  Append the specified `$filename` into the archive.

- $ar-\>**close\_archive()**

  Close the archive and release any allocated resource.

## CHANGES

### Version 0.xx

This is a private module.
