in reply to treemap

Something else I just thought of. There is one other type of tree that people deal with in Perl: directory trees.

If there were someway to tie a directory tree to a nested Perl data structure, then treemap would be roughly equivalent to File::Find, but this time it would require yet another set of context variables to be useful: $File::Find::name, $File::Find::directory, and $_.

Replies are listed 'Best First'.
Re: Re: treemap
by Rudif (Hermit) on Mar 11, 2001 at 02:05 UTC
    Directory tree is an intriguing subject. It looks like an instance of the Composite pattern - nodes are simple nodes (files) and collections (directories).
    I had a go at mapping a dirtree to a tree of hashes, in How to map a directory tree to a perl hash tree and had good advice on how to improve it.
    Do you think that a Perl package would be useful? What methods would you suggest? Should it Tie to the file system?

    Rudif