in reply to Creating table from file lists
The answer depends on what you want: ascii or html table output (consider embperl here) or just a suitable data structure before starting to think about output formatting issues..
As for the data structure itself, how about a a hash := anonymous hash | filename (as key use the basename of the dir | file; read as EBNF). In case of a reference, you're dealing with a directory (inner node of tree), otherwise with a file (leaf). Similar approach if you prefer an array instead.
A variant: KISS - is it suitable to use just the full dirpath as key? Then you can use a non-recursive approach: a hash of anonymous arrays.
cu
Peter
Updates: do check man perlref / perlreftut.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Creating table from file lists
by affc (Scribe) on Oct 05, 2009 at 15:13 UTC |