logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Parse::Debian::Packages - parse the data from a debian Packages.gz

Author

       Richard Clamp <richardc@unixbeard.net> with as_hash implementation by Thomas Klausner.

Description

       This module parses the Packages files used by the debian package management tools.

       It presents itself as an iterator.  Each call of the ->next method will return the next package found in
       the file.

       For laziness, we take a filehandle in to the constructor.  Please open the file for us.

Methods

new($filehandle)next
       Iterate to the next package in the file, returns either a hash containing a package description, or false
       at end of file.

   as_hash($filehandle)
       Return all the packages from a filehandle as a hash of hashes.

Name

       Parse::Debian::Packages - parse the data from a debian Packages.gz

See Also

       Module::Packaged

perl v5.36.0                                       2022-11-19                       Parse::Debian::Packages(3pm)

Synopsis

        use YAML;
        use IO::File;
        use Parse::Debian::Packages;
        my $fh = IO::File->new("Packages");

        my $parser = Parse::Debian::Packages->new( $fh );
        while (my %package = $parser->next) {
            print Dump \%package;
        }

See Also