in reply to Should I Make A Module?
I'm leaning towards it not being worth doing. Something like that is trivial to do with File::Find. Specify the desired data format to produce more closely and someone will likely scribble some code to spit that out in all of a half dozen lines.
I'm not sure it makes a lot of sense, either.. both the directory structure and the resultant data structure are trees, so you need to write tree-traversal code to do anything with either. Why do whatever it is you need to do while traversing a data structure created by traversing the directory structure, and not do the work right as you're traversing the directory structure, with no intermediate data structure involved?
On the other hand, if it's the interface of File::Find you don't like - have you looked for an alternative? Tie::Dir lets you treat directories as hashes on the fly, f.ex; it's trivial to write a few lines of wrapper code around it to traverse directory trees. Or to subclass it to return tied hashes when you look at an entry that represents a directory. Or..
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Should I Make A Module?
by coolmichael (Deacon) on Mar 16, 2003 at 04:25 UTC | |
by Aristotle (Chancellor) on Mar 16, 2003 at 14:25 UTC |