Using system command is the worst way of doing it.
Although the use File::Path qw(remove_tree) is the best.
@jeff : oops ...
User Profile
Collapse
-
Leave a comment:
-
Script to recursively delete
...Code:#!/usr/bin/perl deldir("test"); # or deldir($ARGV[0]) to make it commandline sub deldir { my $dirtodel = pop; my $sep = '\\'; #change this line to "/" on linux. opendir(DIR, $dirtodel); my @files = readdir(DIR); closedir(DIR); @files = grep { !/^\.{1,2}/ } @files; @files = map { $_ = "$dirtodel$sep$_"}Last edited by numberwhun; Nov 27 '09, 01:15 PM. Reason: Personally promoting URLs are not allowed in the forums.Leave a comment:
No activity results to display
Show More
Leave a comment: