in reply to How to iterate over nested hash and get all paths?
I'd reccommed to write subroutines for each "type".
A sub dispatch will take a hash ref and call the corresponding sub for "type".
The sub type_dir will need to loop over the nested array files and call the dispatcher on them.
Show some efforts and show us your implementation for two types dir and file in a smaller SSCCE
With less abstraction:
You could only design sub type_dir as a recursive function calling itself since it's the only nesting one in this case.
The handling on type could be done in a if-ifelse-else block.
But IMHO that's messier and less maintainable.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|