Shlomi Fish avatar Shlomi Fish committed b0a58e7

Add more.

Comments (0)

Files changed (3)

 * Add a page about file/directory-handling :
     - TODO: Add cookbook:
         - appending to files.
+        - copying files.
+        - deleting a directory tree.
             - line count
                 * DONE [Thu 2013-01-17]
             - reading files.
-            - copying files.
             - appending selected portion from a file to another file.
             - prepending to files.
             - overwriting lines in files.
-            - deleting a directory tree.
             - writing to a file.
             - show all with IO::All and without it.
     - Link to:

src/topics/files-and-directories/index.html.wml

         }
     );
 
+    print $ex_gen->html_with_title(
+        {
+            title => "Deleting a directory tree",
+            id_base => "delete_directory_tree",
+            examples =>
+            [
+                {
+                    id => "io_all",
+                    label => "IO-All",
+                    code => <<'EOF',
+use IO::All;
+
+io("./path-to-subdir")->rmtree();
+EOF
+
+                },
+                {
+                    id => "core",
+                    label => "Core Perl",
+                    code => <<'EOF',
+use File::Path qw(rmtree);
+
+rmtree(["./path-to-subdir"], 1, 1);
+EOF
+                },
+            ],
+        }
+    );
 
 :>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.