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.
In reply to Recursive mkdir: is there already a module for this? by jkeenan1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |