Arch::Inventory(3pm) | User Contributed Perl Documentation | Arch::Inventory(3pm) |
Arch::Inventory - class representing a tree inventory
use Arch::Inventory qw(:category :type); my $inv = Arch::Inventory->new; # use cwd print Arch::Inventory->to_string($inv->get_root_entry), "\n"; print $inv->get_listing;
or (most commonly):
use Arch::Tree; my $tree = Arch::Tree->new; my $inv = $tree->get_inventory; print $inv->get_listing;
Arch::Inventory generates a tree inventory.
An inventory is a tree structure of elements, each representing a single directory entry of the source tree. Each inventory entry is described by an hash with the following fields:
This field exists for elements of type DIRECTORY only.
The category and type constants can be conveniently imported using the tags ":category" and ":type".
use Arch::Inventory qw(:category :type);
The following methods are available:
new, directory, get_root_entry, get_entry, get_listing, annotate_fs, foreach, dump, to_string.
The root entry always has the following properties:
$root = { category => TREE, # if {arch} exists, SOURCE otherwise untagged => 1, type => DIRECTORY, path => '', id => undef, children => { ... }, }
If the element does not exist "undef" is returned.
Using an empty or no path is equivalent to calling get_root_entry.
tla inventory -tspbju -B --kind --ids --untagged
Note: The output order is not equivalent to tla. Instead of strict ASCII order of path names, a directory entry is always directly followed by its child entries. Entries with the same parent entry are ASCII ordered.
Awaiting for your reports.
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).
Enno Cramer (uebergeek@web.de--2003/arch-perl--devel).
For more information, see tla, Arch::Util.
2005-10-23 | perl v5.20.2 |