tomazos has asked for the wisdom of the Perl Monks concerning the following question:

I'd like to setup a Perl script to parse the package names, versions (and perhaps descriptions and other metadata) that are installed by dpkg (the standard debian package management system) on a Linux system. I can see this data is stored in /var/lib/dpkg, are there any Perl modules that could help in parsing these files? Or is there some other wrapper to a higher level API for this task?

Also, if anyone knows, is there some way to hook up my Perl script to be executed after whenever the package list changes?

(Essentially we want to keep an up-to-date list of the packages installed on a Linux host in a database.)

Any ideas appreciated.

Thanks, Andrew.