View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Jay Bonci > Archive-Ar-1.13b > Archive::Ar



Annotate this POD

Related Modules



Open  1
View/Report Bugs
Module Version: 1.13b   Source   Latest Release: Archive-Ar-2.02


Archive::Ar - Interface for manipulating ar archives


        use Archive::Ar;

        my $ar = new Archive::Ar("./");

        $ar->add_data("newfile.txt","Some contents", $properties);

        $ar->add_files("./bar.tar.gz", "")

        $ar->remove("file1", "file2");
        $ar->remove(["file1", "file2");

        my $filedata = $ar->get_content("bar.tar.gz");

        my @files = $ar->list_files();




Archive::Ar is a pure-perl way to handle standard ar archives.

This is useful if you have those types of old archives on the system, but it is also useful because .deb packages for the Debian GNU/Linux distribution are ar archives. This is one building block in a future chain of modules to build, manipulate, extract, and test debian modules with no platform or architecture dependence.

You may notice that the API to Archive::Ar is similar to Archive::Tar, and this was done intentionally to keep similarity between the Archive::* modules

Class Methods



A better unit test suite perhaps. I have a private one, but a public one would be nice if there was good file faking module.

Fix / investigate stuff in the BUGS section.


To be honest, I'm not sure of a couple of things. The first is that I know of ar archives made on old AIX systems (pre 4.3?) that have a different header with a different magic string, etc. This module perfectly (hopefully) handles ar archives made with the modern ar command from the binutils distribution. If anyone knows of anyway to produce these old-style AIX archives, or would like to produce a few for testing, I would be much grateful.

There's no really good reason why this module shouldn't run on Win32 platforms, but admittedly, this might change when we have a file exporting function that supports owner and permission writing.

If you read in and write out a file, you get different md5sums, but it's still a valid archive. I'm still investigating this, and consider it a minor bug.


Archive::Ar is copyright 2003 Jay Bonci <>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: