Parse:...ackages(3pm)
β¨ NAME β¨
Parse::Debian::Packages β bestie, it parses the data from a debian Packages.gz π
(it lives in the User Contributed Perl Documentation section of the 3pm man pages, iykyk)
πΈ 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;
}
look at that. clean. gorgeous. no notes. π
π¦ DESCRIPTION π¦
okay so this module parses the Packages files that the debian package management tools use. it's giving infrastructure. it's giving backbone of your entire apt situation.
it presents itself as an iterator, which is just a fancy way of saying it hands you one thing at a time. every single time you call the ->next method, you get the next package found in the file. one at a time. no giant array dumped in your lap. slay.
and for laziness (affectionate β we love laziness here), we take a filehandle in to the constructor. so likeβ¦ you open the file for us, bestie. that's your job. we're not gonna do it. π«Ά
π METHODS π
π new( $filehandle )
the constructor. hand it a filehandle. that's the whole vibe.
β next
iterate to the next package in the file. it returns either a hash containing a package description, or false at end of file.
so like, while (my %package = $parser->next) and you're off. when it runs out, it goes false, the loop ends, everyone goes home happy. π
π as_hash( $filehandle )
return all the packages from a filehandle as a hash of hashes. the whole thing. all at once. main character energy, honestly.
π AUTHOR π
Richard Clamp <richardc@unixbeard.net>, with the as_hash implementation by Thomas Klausner. π
π COPYRIGHT π
Copyright (C) 2003,2005,2012 Richard Clamp. All Rights Reserved.
this module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
fr fr, check the license terms before you go redistributing anything. π«‘
π SEE ALSO π
Module::Packaged
that's the whole page, bestie, no cap. π
this lil masterpiece shipped as part of perl v5.36.0, dated 2022-11-19, and it's filed under Parse:...ackages(3pm). go parse some packages, you absolute icon β¨π¦πΈ
π¦ where this page comes from
- debian bookworm: libparse-debian-packages-perl 0.03-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libparse-debian-packages-perl 0.03-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libparse-debian-packages-perl 0.03-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libparse-debian-packages-perl 0.03-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libparse-debian-packages-perl 0.03-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms