jkeenan1 has asked for the wisdom of the Perl Monks concerning the following question:
my %structure = ( dirs => { albemarle => { dirs => { chatauqua => {}, cattaraugus => {}, }, files => [ qw( washington adams jefferson ) ], }, beverly => { dirs => { ataturk => {}, bonaparte => {}, }, files => [ qw( madison monroe jackson ) ], }, cortelyou => { dirs => { peoria => {}, paducah => {}, }, files => [ qw( vanburen harrison tyler ) ], }, }, files => [ qw( alpha beta gamma ) ], );
I would like to pass a reference to this hash to a function which creates directories and files named and structured as above.
my $return_value = create_structure(\%structure);
The function would create directories and files are needed, leaving already existing directories and files with the same names intact. The return value would be a reference to some data structure that would report, e.g., how many directories and files were created.
This would be useful for me during testing. I did a Super Search of this site, searched CPAN and googled -- but didn't turn anything up. Does anyone know if such functionality has already been written?
Thank you very much.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Recursive mkdir: is there already a module for this?
by GrandFather (Saint) on Jun 17, 2006 at 00:50 UTC | |
by jkeenan1 (Deacon) on Jun 17, 2006 at 00:54 UTC | |
|
Re: Recursive mkdir: is there already a module for this?
by Joost (Canon) on Jun 17, 2006 at 00:48 UTC | |
|
Re: Recursive mkdir: is there already a module for this?
by GrandFather (Saint) on Jun 17, 2006 at 01:08 UTC | |
|
Re: Recursive mkdir: is there already a module for this?
by roboticus (Chancellor) on Jun 17, 2006 at 01:12 UTC |