12.11. Exercise: Tree

 
Implement tree: prints a tree structure of a given directory.
All filenames are printed and subdirectories are properly indented.
$ tree.pl .

.
  subdir_1
    file_1_in_subdir_1
    file_2_in_subdir_1
  subdir_2
    subdir_2_1
      file_1_in_subdir_2_1
    file_1_in_subdir_2

 
Implement the previous one using File::Find

 

 
Implement the previous one using File::Find::Rule

 


If you are interested in on-site trainings by the author, please contact me directly.

Online courses:

Would you like to get
updated when I publish
the next article?

Follow me:

Google Plus Twitter RSS feed