Globalisation Now while you're probably quite bored at this stage by these extraneous explorations of classes which may seem irrelevant to the main business of poking about in the cache, all will now be revealed: Instantiating the cache requires that two (*shudder*) globals be initialised: _config and _system, which are exposed in the Perl interface as $_config which is an exported variable of the AptPkg::Config module, and $_system which is exported by AptPkg::System and uses some deep magic to set the underlying C++ object to the appropriate value when assigned to (by an Apt::System object of course, anything else will cause some measure of grief). use AptPkg::Config '$_config'; use AptPkg::System '$_system'; use AptPkg::Cache; $_config->init; # setup global configuration object $_system = $_config->system; # set global system object $_config->{quiet} = 2; # suppress cache building messages my $cache = AptPkg::Cache->new; # instantiate a new cache object