pmd_dump.pl [options] object-patterns
object-patterns can be:
f=S - Select objects where field f equals string S
f!=S - Select objects where field f does not equal S
f=~R - Select objects where field f matches regex R
f!~R - Select objects where field f does not match R
S$ - Same as filename=~S$ to match by file suffix
S - Same as key=S (i.e. package or filename)
package=Foo::Bar - that specific package
package=~^Foo:: - all packages that start with Foo::
filename=~sub/dir/path - everything with that path in the filename
filename=~\.pm$ - all modules
restart.pl$ - all files with names ending in restart.pl
foo - same as key=foo
Fields available are:
filename - "dir/subdir/foo.pl"
package - "strict"
key - same as package for packages, or filename for other files
filerootdir - "/abs/path"
depends_on - "Carp strict Foo::Bar"
depended_upon_by - "Other::Module dir/subdir/foo.pl dir2/bar.pl Another:Module"
Selected objects can be augmented using:
-P=N Also pre-select N levels of parent objects
-C=N Also pre-select N levels of child objects
-F=P Filter OUT objects matching the object-pattern P
-S=P Only SELECT objects matching the object-pattern P
-M Merge data for selected objects into a single pseudo-object.
Removes internally resolved dependencies.
Handy to see all external dependencies of a group of files.
The -P and -C flags are typically only useful with -M.
-D Delete dependencies on modules which werent indexed but can
be found in @INC
-f=f1,f2,... - only dump these fields (otherwise all)
And for each one dumped:
-p=N Recurse to show N levels of indented parent objects first
-c=N Recurse to show N levels of indented child objects after
-i=S Use S as the indent string (default is a tab)
-u Unique - only show a child or parent once for a given item
-U Unique - only show a child or parent once in complete output
-k Dont show key in header, just the fieldname
-h Dont show header (like grep -h), used with -f=fieldname
-s sort by name
-r=P Show the relationship between the item and those matching P
-A Dump all the data using Data::Dumper
-help Displays this help
-t Displays tracing messages
-o=F the location of the datafile
-r State the relationship, if any, between item1 and item2 - both may be scripts or modules.
pmd_dump.pl -o ./unified.dat Module::Dependency::Info
Select and merge everything in the database (which removes internally resolved
dependencies) and list the names of all unresolved packages:
pmd_dump.pl -f=depends_on -h -M
Do the same but feed the results back into pmd_dump.pl to get details of what
depends on those unresolved items:
pmd_dump.pl -f=depended_upon_by `pmd_dump.pl -f=depends_on -h -M ` | less -S